FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-gitlab/tools/functional/cli/test_cli_artifacts.py at master · Sineaggi/python-gitlab · GitHub
Sineaggi
python-gitlab
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-gitlab
/
tools
/
functional
/
cli
/
test_cli_artifacts.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
52 lines (43 loc) · 1.11 KB
Breadcrumbs
python-gitlab
/
tools
/
functional
/
cli
/
test_cli_artifacts.py
Copy path
File metadata and controls
52 lines (43 loc) · 1.11 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import
subprocess
import
sys
import
textwrap
import
time
from
io
import
BytesIO
from
zipfile
import
is_zipfile
import
pytest
content
=
textwrap
.
dedent
(
"""
\
test-artifact:
script: echo "test" > artifact.txt
artifacts:
untracked: true
"""
)
data
=
{
"file_path"
:
".gitlab-ci.yml"
,
"branch"
:
"master"
,
"content"
:
content
,
"commit_message"
:
"Initial commit"
,
}
@
pytest
.
mark
.
skipif
(
sys
.
version_info
<
(
3
,
8
),
reason
=
"I am the walrus"
)
def
test_cli_artifacts
(
capsysbinary
,
gitlab_config
,
gitlab_runner
,
project
):
project
.
files
.
create
(
data
)
while
not
(
jobs
:=
project
.
jobs
.
list
(
scope
=
"success"
)):
time
.
sleep
(
0.5
)
job
=
project
.
jobs
.
get
(
jobs
[
0
].
id
)
cmd
=
[
"gitlab"
,
"--config-file"
,
gitlab_config
,
"project-job"
,
"artifacts"
,
"--id"
,
str
(
job
.
id
),
"--project-id"
,
str
(
project
.
id
),
]
with
capsysbinary
.
disabled
():
artifacts
=
subprocess
.
check_output
(
cmd
)
assert
isinstance
(
artifacts
,
bytes
)
artifacts_zip
=
BytesIO
(
artifacts
)
assert
is_zipfile
(
artifacts_zip
)
Back
|
FazBrowse Home
|
New Git URL