diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2020-10-08 22:12:35 +0200 |
---|---|---|
committer | Nejc Habjan <nejc.habjan@siemens.com> | 2020-10-08 22:12:35 +0200 |
commit | 65ce02675d9c9580860df91b41c3cf5e6bb8d318 (patch) | |
tree | fb3e62f8e01b2460050439f81ce157c4127abce9 /tools/functional/api | |
parent | 61e43eb186925feede073c7065e5ae868ffbb4ec (diff) | |
download | gitlab-refactor/split-functional-tests.tar.gz |
chore: apply suggestionsrefactor/split-functional-tests
Diffstat (limited to 'tools/functional/api')
-rw-r--r-- | tools/functional/api/test_gitlab.py | 2 | ||||
-rw-r--r-- | tools/functional/api/test_import_export.py | 7 | ||||
-rw-r--r-- | tools/functional/api/test_repository.py | 2 | ||||
-rw-r--r-- | tools/functional/api/test_users.py | 6 |
4 files changed, 12 insertions, 5 deletions
diff --git a/tools/functional/api/test_gitlab.py b/tools/functional/api/test_gitlab.py index 347213c..7a70a56 100644 --- a/tools/functional/api/test_gitlab.py +++ b/tools/functional/api/test_gitlab.py @@ -110,7 +110,7 @@ def test_hooks(gl): def test_namespaces(gl): namespace = gl.namespaces.list(all=True) - assert len(namespace) != 0 + assert namespace namespace = gl.namespaces.list(search="root", all=True)[0] assert namespace.kind == "user" diff --git a/tools/functional/api/test_import_export.py b/tools/functional/api/test_import_export.py index 207d2e9..d4bdd19 100644 --- a/tools/functional/api/test_import_export.py +++ b/tools/functional/api/test_import_export.py @@ -1,5 +1,7 @@ import time +import gitlab + def test_group_import_export(gl, group, temp_dir): export = group.exports.create() @@ -29,7 +31,10 @@ def test_group_import_export(gl, group, temp_dir): def test_project_import_export(gl, project, temp_dir): export = project.exports.create() - export.refresh() + assert export.message == "202 Accepted" + + export = project.exports.get() + assert isinstance(export, gitlab.v4.objects.ProjectExport) count = 0 while export.export_status != "finished": diff --git a/tools/functional/api/test_repository.py b/tools/functional/api/test_repository.py index a2bfd23..c4a8a4b 100644 --- a/tools/functional/api/test_repository.py +++ b/tools/functional/api/test_repository.py @@ -41,7 +41,7 @@ def test_repository_files(project): def test_repository_tree(project): tree = project.repository_tree() - assert len(tree) != 0 + assert tree assert tree[0]["name"] == "README.rst" blob_id = tree[0]["id"] diff --git a/tools/functional/api/test_users.py b/tools/functional/api/test_users.py index e92c0fd..485829d 100644 --- a/tools/functional/api/test_users.py +++ b/tools/functional/api/test_users.py @@ -63,12 +63,14 @@ def test_delete_user(gl, wait_for_sidekiq): def test_user_projects_list(gl, user): projects = user.projects.list() - assert len(projects) == 0 + assert isinstance(projects, list) + assert not projects def test_user_events_list(gl, user): events = user.events.list() - assert len(events) == 0 + assert isinstance(events, list) + assert not events def test_user_bio(gl, user): |