1414import pytest
1515import redis .asyncio as aioredis
1616from aiohttp .test_utils import TestClient
17+ from pytest_simcore .helpers .monkeypatch_envs import setenvs_from_dict
1718from pytest_simcore .helpers .webserver_login import LoggedUser , UserInfoDict
1819from pytest_simcore .helpers .webserver_projects import (
1920 create_project ,
@@ -152,6 +153,7 @@ async def client(
152153 redis_client : aioredis .Redis ,
153154 rabbit_service : RabbitSettings ,
154155 simcore_services_ready : None ,
156+ monkeypatch : pytest .MonkeyPatch ,
155157) -> Iterable [TestClient ]:
156158 # test config & env vars ----------------------
157159 cfg = deepcopy (app_config )
@@ -163,11 +165,24 @@ async def client(
163165
164166 monkeypatch_setenv_from_app_config (cfg )
165167
168+ monkeypatch .delenv ("WEBSERVER_SCICRUNCH" , raising = False )
169+ setenvs_from_dict (
170+ monkeypatch ,
171+ {
172+ "SCICRUNCH_API_KEY" : "REPLACE_ME_with_valid_api_key" ,
173+ "WEBSERVER_RPC_NAMESPACE" : "webserver" ,
174+ },
175+ )
176+
166177 # app setup ----------------------------------
167178 app = create_safe_application (cfg )
168179
169180 # activates only security+restAPI sub-modules
170- assert setup_settings (app )
181+ app_settings = setup_settings (app )
182+
183+ assert app_settings .WEBSERVER_SCICRUNCH is not None
184+ assert app_settings .WEBSERVER_RABBITMQ is not None
185+ assert app_settings .WEBSERVER_EXPORTER is not None
171186 assert (
172187 exporter_settings .get_plugin_settings (app ) is not None
173188 ), "Should capture defaults"
0 commit comments