Skip to content

Commit d1eca27

Browse files
committed
cleanup unused fixture
1 parent f60d19b commit d1eca27

File tree

1 file changed

+1
-47
lines changed

1 file changed

+1
-47
lines changed

services/api-server/tests/unit/conftest.py

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
from models_library.users import UserID
4747
from moto.server import ThreadedMotoServer
4848
from packaging.version import Version
49-
from pydantic import EmailStr, HttpUrl, TypeAdapter, validate_call
49+
from pydantic import EmailStr, HttpUrl, TypeAdapter
5050
from pytest_mock import MockerFixture, MockType
5151
from pytest_simcore.helpers.catalog_rpc_server import CatalogRpcSideEffects
5252
from pytest_simcore.helpers.director_v2_rpc_server import DirectorV2SideEffects
@@ -587,52 +587,6 @@ def mocked_webserver_rpc_api(
587587
}
588588

589589

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-
636590
@pytest.fixture
637591
def catalog_rpc_side_effects(request) -> Any:
638592
if "param" in dir(request) and request.param is not None:

0 commit comments

Comments
 (0)