Skip to content

Commit 65ce026

Browse files
committed
chore: apply suggestions
1 parent 61e43eb commit 65ce026

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

tools/functional/api/test_gitlab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def test_hooks(gl):
110110

111111
def test_namespaces(gl):
112112
namespace = gl.namespaces.list(all=True)
113-
assert len(namespace) != 0
113+
assert namespace
114114

115115
namespace = gl.namespaces.list(search="root", all=True)[0]
116116
assert namespace.kind == "user"

tools/functional/api/test_import_export.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import time
22

3+
import gitlab
4+
35

46
def test_group_import_export(gl, group, temp_dir):
57
export = group.exports.create()
@@ -29,7 +31,10 @@ def test_group_import_export(gl, group, temp_dir):
2931

3032
def test_project_import_export(gl, project, temp_dir):
3133
export = project.exports.create()
32-
export.refresh()
34+
assert export.message == "202 Accepted"
35+
36+
export = project.exports.get()
37+
assert isinstance(export, gitlab.v4.objects.ProjectExport)
3338

3439
count = 0
3540
while export.export_status != "finished":

tools/functional/api/test_repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_repository_files(project):
4141

4242
def test_repository_tree(project):
4343
tree = project.repository_tree()
44-
assert len(tree) != 0
44+
assert tree
4545
assert tree[0]["name"] == "README.rst"
4646

4747
blob_id = tree[0]["id"]

tools/functional/api/test_users.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ def test_delete_user(gl, wait_for_sidekiq):
6363

6464
def test_user_projects_list(gl, user):
6565
projects = user.projects.list()
66-
assert len(projects) == 0
66+
assert isinstance(projects, list)
67+
assert not projects
6768

6869

6970
def test_user_events_list(gl, user):
7071
events = user.events.list()
71-
assert len(events) == 0
72+
assert isinstance(events, list)
73+
assert not events
7274

7375

7476
def test_user_bio(gl, user):

tools/functional/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import tempfile
22
import time
33
import uuid
4-
from contextlib import contextmanager
54
from pathlib import Path
65
from random import randint
76
from subprocess import check_output

0 commit comments

Comments
 (0)