Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5d14867

Browse files
nejchJohnVillalovos
authored andcommitted
fix(cli): fix project export download for CLI
Sinceac1c619 we delete parent arg keysfrom the args dict so this has been trying to access the wrong attribute.
1 parent28cf3c3 commit5d14867

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

‎gitlab/v4/cli.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def do_custom(self) -> Any:
116116

117117
defdo_project_export_download(self)->None:
118118
try:
119-
project=self.gl.projects.get(int(self.args["project_id"]),lazy=True)
119+
project=self.gl.projects.get(self.parent_args["project_id"],lazy=True)
120120
export_status=project.exports.get()
121121
ifTYPE_CHECKING:
122122
assertexport_statusisnotNone

‎tests/functional/cli/test_cli_projects.py‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
importsubprocess
2+
importtime
3+
14
importpytest
25
importresponses
36

@@ -25,3 +28,34 @@ def test_project_registry_delete_in_bulk(
2528
]
2629
ret=ret=script_runner.run(*cmd)
2730
assertret.success
31+
32+
33+
@pytest.fixture
34+
defproject_export(project):
35+
export=project.exports.create()
36+
export.refresh()
37+
38+
count=0
39+
whileexport.export_status!="finished":
40+
time.sleep(0.5)
41+
export.refresh()
42+
count+=1
43+
ifcount==30:
44+
raiseException("Project export taking too much time")
45+
46+
returnexport
47+
48+
49+
deftest_project_export_download(gitlab_config,project_export):
50+
cmd= [
51+
"gitlab",
52+
"--config-file",
53+
gitlab_config,
54+
"project-export",
55+
"download",
56+
"--project-id",
57+
str(project_export.id),
58+
]
59+
60+
export=subprocess.run(cmd,capture_output=True,check=True)
61+
assertexport.returncode==0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp