Skip to content

Commit 63706fc

Browse files
add mock
1 parent 7a700f4 commit 63706fc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

services/director-v2/tests/unit/with_dbs/test_utils_dask.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
from simcore_service_director_v2.models.comp_runs import RunMetadataDict
4848
from simcore_service_director_v2.models.comp_tasks import CompTaskAtDB
4949
from simcore_service_director_v2.modules.dask_clients_pool import DaskClientsPool
50+
from simcore_service_director_v2.modules.osparc_variables import substitutions
5051
from simcore_service_director_v2.utils.dask import (
5152
_LOGS_FILE_NAME,
5253
_to_human_readable_resource_values,
@@ -507,6 +508,14 @@ def _app_config_with_dask_client(
507508
)
508509

509510

511+
@pytest.fixture
512+
def mock_rpc_calls(mocker: MockerFixture, initialized_app: FastAPI) -> None:
513+
initialized_app.state.rabbitmq_rpc_client = mock.AsyncMock()
514+
mocker.patch.object(
515+
substitutions, "get_product_api_base_url", return_value="https://osparc.io"
516+
)
517+
518+
510519
async def test_check_if_cluster_is_able_to_run_pipeline(
511520
_app_config_with_dask_client: None,
512521
project_id: ProjectID,
@@ -614,6 +623,7 @@ async def test_compute_task_envs(
614623
input_task_envs: ContainerEnvsDict,
615624
expected_computed_task_envs: ContainerEnvsDict,
616625
resource_tracking_run_id: ServiceRunID,
626+
mock_rpc_calls: None,
617627
):
618628
sleeper_task: CompTaskAtDB = published_project.tasks[1]
619629
sleeper_task.image.envs = input_task_envs

0 commit comments

Comments
 (0)