diff options
| author | Nejc Habjan <hab.nejc@gmail.com> | 2021-04-17 17:07:55 +0200 |
|---|---|---|
| committer | John Villalovos <john@sodarock.com> | 2021-05-31 20:43:30 -0700 |
| commit | 79d88bde9e5e6c33029e4a9f26c97404e6a7a874 (patch) | |
| tree | c06b8347690c0f64d9dc9a113ceadd1fc7f4cd29 /tests/functional/cli/test_cli_packages.py | |
| parent | fbbc0d400015d7366952a66e4401215adff709f0 (diff) | |
| download | gitlab-79d88bde9e5e6c33029e4a9f26c97404e6a7a874.tar.gz | |
feat(objects): add support for generic packages API
Diffstat (limited to 'tests/functional/cli/test_cli_packages.py')
| -rw-r--r-- | tests/functional/cli/test_cli_packages.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/functional/cli/test_cli_packages.py b/tests/functional/cli/test_cli_packages.py index a3734a2..d7cdd18 100644 --- a/tests/functional/cli/test_cli_packages.py +++ b/tests/functional/cli/test_cli_packages.py @@ -1,3 +1,9 @@ +package_name = "hello-world" +package_version = "v1.0.0" +file_name = "hello.tar.gz" +file_content = "package content" + + def test_list_project_packages(gitlab_cli, project): cmd = ["project-package", "list", "--project-id", project.id] ret = gitlab_cli(cmd) @@ -10,3 +16,45 @@ def test_list_group_packages(gitlab_cli, group): ret = gitlab_cli(cmd) assert ret.success + + +def test_upload_generic_package(tmp_path, gitlab_cli, project): + path = tmp_path / file_name + path.write_text(file_content) + + cmd = [ + "-v", + "generic-package", + "upload", + "--project-id", + project.id, + "--package-name", + package_name, + "--path", + path, + "--package-version", + package_version, + "--file-name", + file_name, + ] + ret = gitlab_cli(cmd) + + assert "201 Created" in ret.stdout + + +def test_download_generic_package(gitlab_cli, project): + cmd = [ + "generic-package", + "download", + "--project-id", + project.id, + "--package-name", + package_name, + "--package-version", + package_version, + "--file-name", + file_name, + ] + ret = gitlab_cli(cmd) + + assert ret.stdout == file_content |
