Skip to content

Commit 3fe0078

Browse files
committed
fixes user_role enum
1 parent 9197aa6 commit 3fe0078

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

services/web/server/tests/unit/isolated/conftest.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from pathlib import Path
55

66
import pytest
7-
import simcore_service_webserver
8-
import simcore_service_webserver.security
97
from faker import Faker
108
from pytest_mock import MockerFixture, MockType
119
from pytest_simcore.helpers.monkeypatch_envs import (
@@ -21,7 +19,7 @@ def dir_with_random_content(tmpdir, faker: Faker) -> Path:
2119
def make_files_in_dir(dir_path: Path, file_count: int) -> None:
2220
for _ in range(file_count):
2321
(dir_path / f"{faker.file_name(extension='bin')}").write_bytes(
24-
os.urandom(random.randint(1, 10))
22+
os.urandom(random.randint(1, 10)) # noqa: S311
2523
)
2624

2725
def ensure_dir(path_to_ensure: Path) -> Path:
@@ -32,13 +30,13 @@ def make_subdirectory_with_content(subdir_name: Path, max_file_count: int) -> No
3230
subdir_name = ensure_dir(subdir_name)
3331
make_files_in_dir(
3432
dir_path=subdir_name,
35-
file_count=random.randint(1, max_file_count),
33+
file_count=random.randint(1, max_file_count), # noqa: S311
3634
)
3735

3836
def make_subdirectories_with_content(
3937
subdir_name: Path, max_subdirectories_count: int, max_file_count: int
4038
) -> None:
41-
subdirectories_count = random.randint(1, max_subdirectories_count)
39+
subdirectories_count = random.randint(1, max_subdirectories_count) # noqa: S311
4240
for _ in range(subdirectories_count):
4341
make_subdirectory_with_content(
4442
subdir_name=subdir_name / f"{faker.word()}",

services/web/server/tests/unit/with_dbs/01/groups/test_groups_handlers_crud.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async def test_list_user_groups_and_try_modify_organizations(
5959
):
6060
assert client.app
6161
assert logged_user["id"] != standard_groups_owner["id"]
62-
assert logged_user["role"] == user_role.value
62+
assert logged_user["role"] == user_role
6363

6464
# List all groups (organizations, primary, everyone and products) I belong to
6565
url = client.app.router["list_groups"].url_for()
@@ -130,7 +130,7 @@ async def test_group_creation_workflow(
130130
):
131131
assert client.app
132132
assert logged_user["id"] != 0
133-
assert logged_user["role"] == user_role.value
133+
assert logged_user["role"] == user_role
134134

135135
url = client.app.router["create_group"].url_for()
136136
new_group_data = {

services/web/server/tests/unit/with_dbs/01/groups/test_groups_handlers_users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ async def test_create_organization_and_add_users(
552552
):
553553
assert client.app
554554
assert logged_user["id"] != 0
555-
assert logged_user["role"] == user_role.value
555+
assert logged_user["role"] == user_role
556556

557557
# CREATE GROUP
558558
url = client.app.router["create_group"].url_for()

services/web/server/tests/unit/with_dbs/02/test_projects_groups_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ async def test_share_project_with_roles(
311311
):
312312
assert client.app
313313

314-
assert logged_user["role"] == user_role.value
314+
assert logged_user["role"] == user_role
315315

316316
# Attempt to share the project
317317
url = client.app.router["share_project"].url_for(

services/web/server/tests/unit/with_dbs/04/products/test_products_rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ async def test_get_current_product_ui(
135135
user_role: UserRole,
136136
expected_status_code: int,
137137
):
138-
assert logged_user["role"] == user_role.value
138+
assert logged_user["role"] == user_role
139139
assert product_name in app_products_names
140140

141141
# give access to user to this product

0 commit comments

Comments
 (0)