|
56 | 56 | from pytest_simcore.helpers.webserver_parametrizations import ( |
57 | 57 | ExpectedResponse, |
58 | 58 | standard_role_response, |
| 59 | + standard_user_role_response, |
59 | 60 | ) |
60 | 61 | from pytest_simcore.helpers.webserver_projects import assert_get_same_project |
61 | 62 | from pytest_simcore.helpers.webserver_users import UserInfoDict |
@@ -569,8 +570,6 @@ async def test_open_template_project_for_edition( |
569 | 570 | @pytest.mark.parametrize( |
570 | 571 | "user_role,expected", |
571 | 572 | [ |
572 | | - (UserRole.ANONYMOUS, status.HTTP_401_UNAUTHORIZED), |
573 | | - (UserRole.GUEST, status.HTTP_403_FORBIDDEN), |
574 | 573 | (UserRole.USER, status.HTTP_403_FORBIDDEN), |
575 | 574 | (UserRole.TESTER, status.HTTP_403_FORBIDDEN), |
576 | 575 | ], |
@@ -600,13 +599,7 @@ async def test_open_template_project_for_edition_with_missing_write_rights( |
600 | 599 | await assert_status(resp, expected) |
601 | 600 |
|
602 | 601 |
|
603 | | -def standard_user_role() -> tuple[str, tuple]: |
604 | | - all_roles = standard_role_response() |
605 | | - |
606 | | - return (all_roles[0], (pytest.param(*all_roles[1][2], id="standard user role"),)) |
607 | | - |
608 | | - |
609 | | -@pytest.mark.parametrize(*standard_user_role()) |
| 602 | +@pytest.mark.parametrize(*standard_user_role_response()) |
610 | 603 | async def test_open_project_with_small_amount_of_dynamic_services_starts_them_automatically( |
611 | 604 | client: TestClient, |
612 | 605 | logged_user: UserInfoDict, |
@@ -652,7 +645,7 @@ async def test_open_project_with_small_amount_of_dynamic_services_starts_them_au |
652 | 645 | ].reset_mock() |
653 | 646 |
|
654 | 647 |
|
655 | | -@pytest.mark.parametrize(*standard_user_role()) |
| 648 | +@pytest.mark.parametrize(*standard_user_role_response()) |
656 | 649 | async def test_open_project_with_disable_service_auto_start_set_overrides_behavior( |
657 | 650 | client: TestClient, |
658 | 651 | logged_user: UserInfoDict, |
@@ -696,7 +689,7 @@ async def test_open_project_with_disable_service_auto_start_set_overrides_behavi |
696 | 689 | ].assert_not_called() |
697 | 690 |
|
698 | 691 |
|
699 | | -@pytest.mark.parametrize(*standard_user_role()) |
| 692 | +@pytest.mark.parametrize(*standard_user_role_response()) |
700 | 693 | async def test_open_project_with_large_amount_of_dynamic_services_does_not_start_them_automatically( |
701 | 694 | client: TestClient, |
702 | 695 | logged_user: UserInfoDict, |
@@ -741,7 +734,7 @@ async def test_open_project_with_large_amount_of_dynamic_services_does_not_start |
741 | 734 | ].assert_not_called() |
742 | 735 |
|
743 | 736 |
|
744 | | -@pytest.mark.parametrize(*standard_user_role()) |
| 737 | +@pytest.mark.parametrize(*standard_user_role_response()) |
745 | 738 | async def test_open_project_with_large_amount_of_dynamic_services_starts_them_if_setting_disabled( |
746 | 739 | mock_get_total_project_dynamic_nodes_creation_interval: None, |
747 | 740 | disable_max_number_of_running_dynamic_nodes: dict[str, str], |
@@ -791,7 +784,7 @@ async def test_open_project_with_large_amount_of_dynamic_services_starts_them_if |
791 | 784 | ].assert_called() |
792 | 785 |
|
793 | 786 |
|
794 | | -@pytest.mark.parametrize(*standard_user_role()) |
| 787 | +@pytest.mark.parametrize(*standard_user_role_response()) |
795 | 788 | async def test_open_project_with_deprecated_services_ok_but_does_not_start_dynamic_services( |
796 | 789 | client: TestClient, |
797 | 790 | logged_user, |
@@ -843,7 +836,7 @@ def one_max_open_studies_per_user( |
843 | 836 | ) |
844 | 837 |
|
845 | 838 |
|
846 | | -@pytest.mark.parametrize(*standard_role_response()) |
| 839 | +@pytest.mark.parametrize(*standard_user_role_response()) |
847 | 840 | async def test_open_project_more_than_limitation_of_max_studies_open_per_user( |
848 | 841 | one_max_open_studies_per_user: None, |
849 | 842 | client: TestClient, |
@@ -1264,7 +1257,7 @@ def clean_redis_table(redis_client) -> None: |
1264 | 1257 | """this just ensures the redis table is cleaned up between test runs""" |
1265 | 1258 |
|
1266 | 1259 |
|
1267 | | -@pytest.mark.parametrize(*standard_role_response()) |
| 1260 | +@pytest.mark.parametrize(*standard_user_role_response()) |
1268 | 1261 | async def test_open_shared_project_2_users_locked( |
1269 | 1262 | client: TestClient, |
1270 | 1263 | client_on_running_server_factory: Callable[[], TestClient], |
@@ -1465,7 +1458,7 @@ async def test_open_shared_project_2_users_locked( |
1465 | 1458 | ) |
1466 | 1459 |
|
1467 | 1460 |
|
1468 | | -@pytest.mark.parametrize(*standard_role_response()) |
| 1461 | +@pytest.mark.parametrize(*standard_user_role_response()) |
1469 | 1462 | async def test_open_shared_project_at_same_time( |
1470 | 1463 | client: TestClient, |
1471 | 1464 | client_on_running_server_factory: Callable[[], TestClient], |
@@ -1558,7 +1551,7 @@ async def test_open_shared_project_at_same_time( |
1558 | 1551 | assert num_assertions == NUMBER_OF_ADDITIONAL_CLIENTS |
1559 | 1552 |
|
1560 | 1553 |
|
1561 | | -@pytest.mark.parametrize(*standard_role_response()) |
| 1554 | +@pytest.mark.parametrize(*standard_user_role_response()) |
1562 | 1555 | async def test_opened_project_can_still_be_opened_after_refreshing_tab( |
1563 | 1556 | client: TestClient, |
1564 | 1557 | logged_user: dict[str, Any], |
|
0 commit comments