1515from aiohttp .test_utils import TestClient
1616from aioresponses import aioresponses
1717from faker import Faker
18- from models_library .api_schemas_directorv2 .dynamic_services import (
19- GetProjectInactivityResponse ,
20- )
2118from models_library .products import ProductName
2219from models_library .projects_state import ProjectState
2320from pydantic import TypeAdapter
24- from pytest_mock import MockerFixture
2521from pytest_simcore .helpers .assert_checks import assert_status
2622from pytest_simcore .helpers .webserver_login import UserInfoDict
2723from pytest_simcore .helpers .webserver_parametrizations import (
@@ -658,30 +654,19 @@ async def test_new_template_from_project(
658654 TypeAdapter (uuidlib .UUID ).validate_python (node_name )
659655
660656
661- @pytest .fixture
662- def mock_dynamic_scheduler_inactivity (mocker : MockerFixture , is_inactive : bool ) -> None :
663- mocker .patch (
664- "simcore_service_webserver.projects.projects_api.dynamic_scheduler_api.get_project_inactivity" ,
665- return_value = GetProjectInactivityResponse (is_inactive = is_inactive ),
666- )
667-
668-
669657@pytest .mark .parametrize (
670658 "user_role,expected" ,
671659 [
672660 (UserRole .ANONYMOUS , status .HTTP_401_UNAUTHORIZED ),
673661 * ((role , status .HTTP_200_OK ) for role in UserRole if role > UserRole .ANONYMOUS ),
674662 ],
675663)
676- @pytest .mark .parametrize ("is_inactive" , [True , False ])
677664async def test_get_project_inactivity (
678- mock_dynamic_scheduler_inactivity : None ,
679665 logged_user : UserInfoDict ,
680666 client : TestClient ,
681667 faker : Faker ,
682668 user_role : UserRole ,
683669 expected : HTTPStatus ,
684- is_inactive : bool ,
685670):
686671 mock_project_id = faker .uuid4 ()
687672
@@ -697,4 +682,4 @@ async def test_get_project_inactivity(
697682
698683 assert data
699684 assert error is None
700- assert data ["is_inactive" ] is is_inactive
685+ assert data ["is_inactive" ] is True
0 commit comments