@@ -160,13 +160,22 @@ async def fake_app(faker: Faker) -> AsyncIterable[FastAPI]:
160160 yield app
161161
162162
163+ @pytest .fixture
164+ def mock_rpc_calls (mocker : MockerFixture , fake_app : FastAPI ) -> None :
165+ fake_app .state .rabbitmq_rpc_client = AsyncMock ()
166+ mocker .patch .object (
167+ substitutions , "get_product_api_base_url" , return_value = "https://osparc.io"
168+ )
169+
170+
163171@pytest .mark .parametrize ("wallet_id" , [None , 12 ])
164172async def test_resolve_and_substitute_session_variables_in_specs (
165173 mock_user_repo : None ,
166174 mock_osparc_variables_api_auth_rpc : None ,
167175 fake_app : FastAPI ,
168176 faker : Faker ,
169177 wallet_id : WalletID | None ,
178+ mock_rpc_calls : None ,
170179):
171180 specs = {
172181 "product_name" : "${OSPARC_VARIABLE_PRODUCT_NAME}" ,
@@ -211,7 +220,10 @@ def mock_get_vendor_secrets(mocker: MockerFixture, mock_repo_db_engine: None) ->
211220
212221
213222async def test_substitute_vendor_secrets_in_specs (
214- mock_get_vendor_secrets : None , fake_app : FastAPI , faker : Faker
223+ mock_get_vendor_secrets : None ,
224+ fake_app : FastAPI ,
225+ faker : Faker ,
226+ mock_rpc_calls : None ,
215227):
216228 specs = {
217229 "vendor_secret_one" : "${OSPARC_VARIABLE_VENDOR_SECRET_ONE}" ,
@@ -223,8 +235,10 @@ async def test_substitute_vendor_secrets_in_specs(
223235 fake_app ,
224236 specs = specs ,
225237 product_name = "a_product" ,
226- service_key = ServiceKey ("simcore/services/dynamic/fake" ),
227- service_version = ServiceVersion ("0.0.1" ),
238+ service_key = TypeAdapter (ServiceKey ).validate_python (
239+ "simcore/services/dynamic/fake"
240+ ),
241+ service_version = TypeAdapter (ServiceVersion ).validate_python ("0.0.1" ),
228242 )
229243 print ("REPLACED SPECS\n " , replaced_specs )
230244
0 commit comments