Skip to content

Commit 7815f8d

Browse files
author
Andrei Neagu
committed
fixeed tests
1 parent 258a979 commit 7815f8d

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

services/web/server/tests/unit/with_dbs/04/studies_dispatcher/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414

1515
@pytest.fixture
16-
def app_environment(app_environment: EnvVarsDict, monkeypatch: pytest.MonkeyPatch):
16+
def app_environment(
17+
app_environment: EnvVarsDict, monkeypatch: pytest.MonkeyPatch
18+
) -> EnvVarsDict:
1719
envs_plugins = setenvs_from_dict(
1820
monkeypatch,
1921
{

services/web/server/tests/unit/with_dbs/04/studies_dispatcher/test_studies_dispatcher_handlers.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,33 @@
1515
from aiohttp import ClientResponse, ClientSession
1616
from aiohttp.test_utils import TestClient, TestServer
1717
from aioresponses import aioresponses
18+
from common_library.json_serialization import json_dumps
19+
from common_library.serialization import model_dump_with_secrets
1820
from common_library.users_enums import UserRole
1921
from models_library.projects_state import ProjectShareState, ProjectStatus
2022
from pydantic import BaseModel, ByteSize, TypeAdapter
2123
from pytest_mock import MockerFixture
2224
from pytest_simcore.helpers.assert_checks import assert_status
25+
from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict
26+
from pytest_simcore.helpers.typing_env import EnvVarsDict
2327
from pytest_simcore.helpers.webserver_users import UserInfoDict
2428
from pytest_simcore.pydantic_models import (
2529
assert_validation_model,
2630
walk_model_examples_in_package,
2731
)
2832
from servicelib.aiohttp import status
33+
from settings_library.rabbit import RabbitSettings
2934
from settings_library.redis import RedisSettings
3035
from settings_library.utils_session import DEFAULT_SESSION_COOKIE_NAME
3136
from simcore_service_webserver.studies_dispatcher._core import ViewerInfo
3237
from simcore_service_webserver.studies_dispatcher._rest_handlers import ServiceGet
3338
from sqlalchemy.sql import text
3439
from yarl import URL
3540

41+
pytest_simcore_core_services_selection = [
42+
"rabbit",
43+
]
44+
3645
#
3746
# FIXTURES OVERRIDES
3847
#
@@ -76,7 +85,25 @@ def postgres_db(postgres_db: sa.engine.Engine) -> sa.engine.Engine:
7685

7786

7887
@pytest.fixture
79-
def web_server(redis_service: RedisSettings, web_server: TestServer) -> TestServer:
88+
def app_environment(
89+
app_environment: EnvVarsDict,
90+
monkeypatch: pytest.MonkeyPatch,
91+
rabbit_service: RabbitSettings,
92+
) -> EnvVarsDict:
93+
return setenvs_from_dict(
94+
monkeypatch,
95+
{
96+
"WEBSERVER_RABBITMQ": json_dumps(
97+
model_dump_with_secrets(rabbit_service, show_secrets=True)
98+
)
99+
},
100+
)
101+
102+
103+
@pytest.fixture
104+
def web_server(
105+
redis_service: RedisSettings, rabbit_service: RabbitSettings, web_server: TestServer
106+
) -> TestServer:
80107
#
81108
# Extends web_server to start redis_service
82109
#

0 commit comments

Comments
 (0)