summaryrefslogtreecommitdiff
path: root/tests/functional/api
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-11-28 02:17:56 +0100
committerGitHub <noreply@github.com>2021-11-28 02:17:56 +0100
commit09a973ee379d82af05a5080decfaec16d2f4eab3 (patch)
treedf53d3f94109d124f4e8625d10417110f164d35a /tests/functional/api
parent93a3893977d4e3a3e1916a94293e66373b1458fb (diff)
parent381c748415396e0fe54bb1f41a3303bab89aa065 (diff)
downloadgitlab-09a973ee379d82af05a5080decfaec16d2f4eab3.tar.gz
Merge pull request #1721 from python-gitlab/test/cli-coverage
test(cli): improve basic CLI coverage
Diffstat (limited to 'tests/functional/api')
-rw-r--r--tests/functional/api/test_users.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/functional/api/test_users.py b/tests/functional/api/test_users.py
index 1ef237c..edbbca1 100644
--- a/tests/functional/api/test_users.py
+++ b/tests/functional/api/test_users.py
@@ -3,23 +3,17 @@ GitLab API:
https://docs.gitlab.com/ee/api/users.html
https://docs.gitlab.com/ee/api/users.html#delete-authentication-identity-from-user
"""
-import pytest
import requests
-@pytest.fixture(scope="session")
-def avatar_path(test_dir):
- return test_dir / "fixtures" / "avatar.png"
-
-
-def test_create_user(gl, avatar_path):
+def test_create_user(gl, fixture_dir):
user = gl.users.create(
{
"email": "foo@bar.com",
"username": "foo",
"name": "foo",
"password": "foo_password",
- "avatar": open(avatar_path, "rb"),
+ "avatar": open(fixture_dir / "avatar.png", "rb"),
}
)
@@ -29,7 +23,7 @@ def test_create_user(gl, avatar_path):
avatar_url = user.avatar_url.replace("gitlab.test", "localhost:8080")
uploaded_avatar = requests.get(avatar_url).content
- assert uploaded_avatar == open(avatar_path, "rb").read()
+ assert uploaded_avatar == open(fixture_dir / "avatar.png", "rb").read()
def test_block_user(gl, user):