Skip to content

Commit f3c6273

Browse files
♻️ rearranging webserver tests (#6633)
1 parent f5f61b1 commit f3c6273

23 files changed

+140
-167
lines changed

β€Žservices/web/server/tests/integration/02/test_computation.pyβ€Ž

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -95,28 +95,10 @@ def __str__(self) -> str:
9595
return f"{self.__class__.__name__}({items})"
9696

9797

98-
def standard_role_response():
98+
def user_role_response():
9999
return (
100100
"user_role,expected",
101101
[
102-
pytest.param(
103-
UserRole.ANONYMOUS,
104-
_ExpectedResponseTuple(
105-
ok=status.HTTP_401_UNAUTHORIZED,
106-
created=status.HTTP_401_UNAUTHORIZED,
107-
no_content=status.HTTP_401_UNAUTHORIZED,
108-
confict=status.HTTP_401_UNAUTHORIZED,
109-
),
110-
),
111-
pytest.param(
112-
UserRole.GUEST,
113-
_ExpectedResponseTuple(
114-
ok=status.HTTP_200_OK,
115-
created=status.HTTP_201_CREATED,
116-
no_content=status.HTTP_204_NO_CONTENT,
117-
confict=status.HTTP_409_CONFLICT,
118-
),
119-
),
120102
pytest.param(
121103
UserRole.USER,
122104
_ExpectedResponseTuple(
@@ -126,15 +108,6 @@ def standard_role_response():
126108
confict=status.HTTP_409_CONFLICT,
127109
),
128110
),
129-
pytest.param(
130-
UserRole.TESTER,
131-
_ExpectedResponseTuple(
132-
ok=status.HTTP_200_OK,
133-
created=status.HTTP_201_CREATED,
134-
no_content=status.HTTP_204_NO_CONTENT,
135-
confict=status.HTTP_409_CONFLICT,
136-
),
137-
),
138111
],
139112
)
140113

@@ -365,7 +338,7 @@ async def _assert_and_wait_for_comp_task_states_to_be_transmitted_in_projects(
365338
)
366339

367340

368-
@pytest.mark.parametrize(*standard_role_response(), ids=str)
341+
@pytest.mark.parametrize(*user_role_response(), ids=str)
369342
async def test_start_stop_computation(
370343
client: TestClient,
371344
sleeper_service: dict[str, str],
@@ -438,7 +411,7 @@ async def test_start_stop_computation(
438411
)
439412

440413

441-
@pytest.mark.parametrize(*standard_role_response(), ids=str)
414+
@pytest.mark.parametrize(*user_role_response(), ids=str)
442415
async def test_run_pipeline_and_check_state(
443416
client: TestClient,
444417
sleeper_service: dict[str, str],

0 commit comments

Comments
Β (0)