|
46 | 46 | from models_library.users import UserID |
47 | 47 | from moto.server import ThreadedMotoServer |
48 | 48 | from packaging.version import Version |
49 | | -from pydantic import EmailStr, HttpUrl, TypeAdapter, validate_call |
| 49 | +from pydantic import EmailStr, HttpUrl, TypeAdapter |
50 | 50 | from pytest_mock import MockerFixture, MockType |
51 | 51 | from pytest_simcore.helpers.catalog_rpc_server import CatalogRpcSideEffects |
52 | 52 | from pytest_simcore.helpers.director_v2_rpc_server import DirectorV2SideEffects |
@@ -587,52 +587,6 @@ def mocked_webserver_rpc_api( |
587 | 587 | } |
588 | 588 |
|
589 | 589 |
|
590 | | -@pytest.fixture |
591 | | -def mocked_get_project_marked_as_job_storage_data_missing( |
592 | | - mocked_webserver_rpc_api: dict[str, MockType], mocker: MockerFixture |
593 | | -) -> dict[str, MockType]: |
594 | | - from servicelib.rabbitmq.rpc_interfaces.webserver import ( |
595 | | - projects as projects_rpc, # keep import here |
596 | | - ) |
597 | | - |
598 | | - @validate_call(config={"arbitrary_types_allowed": True}) |
599 | | - async def _get_project_marked_as_job( |
600 | | - rpc_client: RabbitMQRPCClient | MockType, |
601 | | - *, |
602 | | - product_name: ProductName, |
603 | | - user_id: UserID, |
604 | | - project_uuid: ProjectID, |
605 | | - job_parent_resource_name: str, |
606 | | - ) -> ProjectJobRpcGet: |
607 | | - assert rpc_client |
608 | | - assert product_name |
609 | | - assert user_id |
610 | | - assert project_uuid |
611 | | - assert job_parent_resource_name |
612 | | - |
613 | | - # Return a valid example from the schema |
614 | | - example = ProjectJobRpcGet.model_json_schema()["examples"][0] |
615 | | - example["uuid"] = str(project_uuid) |
616 | | - example["job_parent_resource_name"] = job_parent_resource_name |
617 | | - example["storage_data_deleted"] = "true" |
618 | | - project_job_rpc_get = ProjectJobRpcGet.model_validate(example) |
619 | | - assert project_job_rpc_get.storage_data_deleted is True |
620 | | - return project_job_rpc_get |
621 | | - |
622 | | - # Remove the previous patch if it exists |
623 | | - mocked_webserver_rpc_api["get_project_marked_as_job"].reset_mock() |
624 | | - del mocked_webserver_rpc_api["get_project_marked_as_job"] |
625 | | - |
626 | | - # Add the new patch with the custom side effect |
627 | | - mocked_webserver_rpc_api["get_project_marked_as_job"] = mocker.patch.object( |
628 | | - projects_rpc, |
629 | | - "get_project_marked_as_job", |
630 | | - autospec=True, |
631 | | - side_effect=_get_project_marked_as_job, |
632 | | - ) |
633 | | - return mocked_webserver_rpc_api |
634 | | - |
635 | | - |
636 | 590 | @pytest.fixture |
637 | 591 | def catalog_rpc_side_effects(request) -> Any: |
638 | 592 | if "param" in dir(request) and request.param is not None: |
|
0 commit comments