diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-27 20:28:15 +0100 |
---|---|---|
committer | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-27 21:08:47 +0100 |
commit | 6b892e3dcb18d0f43da6020b08fd4ba891da3670 (patch) | |
tree | e97beaaca3b5b94764f78e0fd99df0c53fd19f8b /tests/functional/api/test_users.py | |
parent | 70b9870f929c4db32fd2e1406db2122de9958bfd (diff) | |
download | gitlab-test/cli-coverage.tar.gz |
test(cli): improve basic CLI coveragetest/cli-coverage
Diffstat (limited to 'tests/functional/api/test_users.py')
-rw-r--r-- | tests/functional/api/test_users.py | 12 |
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): |