diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-05-31 22:25:59 +0200 |
---|---|---|
committer | John Villalovos <john@sodarock.com> | 2022-06-01 08:00:51 -0700 |
commit | 5d1486785793b02038ac6f527219801744ee888b (patch) | |
tree | 26a92a1a9ab4d604bb67d1d67db017d8d4b0f34e /tests/functional | |
parent | 28cf3c3d392f2f7f55dc142681181e15c702018a (diff) | |
download | gitlab-5d1486785793b02038ac6f527219801744ee888b.tar.gz |
fix(cli): fix project export download for CLI
Since ac1c619cae6481833f5df91862624bf0380fef67 we delete parent arg keys
from the args dict so this has been trying to access the wrong attribute.
Diffstat (limited to 'tests/functional')
-rw-r--r-- | tests/functional/cli/test_cli_projects.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/functional/cli/test_cli_projects.py b/tests/functional/cli/test_cli_projects.py index bf7f564..c514af4 100644 --- a/tests/functional/cli/test_cli_projects.py +++ b/tests/functional/cli/test_cli_projects.py @@ -1,3 +1,6 @@ +import subprocess +import time + import pytest import responses @@ -25,3 +28,34 @@ def test_project_registry_delete_in_bulk( ] ret = ret = script_runner.run(*cmd) assert ret.success + + +@pytest.fixture +def project_export(project): + export = project.exports.create() + export.refresh() + + count = 0 + while export.export_status != "finished": + time.sleep(0.5) + export.refresh() + count += 1 + if count == 30: + raise Exception("Project export taking too much time") + + return export + + +def test_project_export_download(gitlab_config, project_export): + cmd = [ + "gitlab", + "--config-file", + gitlab_config, + "project-export", + "download", + "--project-id", + str(project_export.id), + ] + + export = subprocess.run(cmd, capture_output=True, check=True) + assert export.returncode == 0 |