| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,7 +116,7 @@ def do_custom(self) -> Any: | |||
| 116 | 116 | ||
| 117 | 117 | def do_project_export_download(self) -> None: | |
| 118 | 118 | 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) | ||
| 120 | 120 | export_status = project.exports.get() | |
| 121 | 121 | if TYPE_CHECKING: | |
| 122 | 122 | assert export_status is not None | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,6 @@ | |||
| 1 | + import subprocess | ||
| 2 | + import time | ||
| 3 | + | ||
| 1 | 4 | import pytest | |
| 2 | 5 | import responses | |
| 3 | 6 | ||
@@ -25,3 +28,34 @@ def test_project_registry_delete_in_bulk( | |||
| 25 | 28 | ] | |
| 26 | 29 | ret = ret = script_runner.run(*cmd) | |
| 27 | 30 | assert ret.success | |
| 31 | + | ||
| 32 | + | ||
| 33 | + @pytest.fixture | ||
| 34 | + def project_export(project): | ||
| 35 | + export = project.exports.create() | ||
| 36 | + export.refresh() | ||
| 37 | + | ||
| 38 | + count = 0 | ||
| 39 | + while export.export_status != "finished": | ||
| 40 | + time.sleep(0.5) | ||
| 41 | + export.refresh() | ||
| 42 | + count += 1 | ||
| 43 | + if count == 30: | ||
| 44 | + raise Exception("Project export taking too much time") | ||
| 45 | + | ||
| 46 | + return export | ||
| 47 | + | ||
| 48 | + | ||
| 49 | + def test_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 | + assert export.returncode == 0 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments