Skip to content

Commit 3402c26

Browse files
committed
context for wb-api-server
1 parent cfc7fbe commit 3402c26

File tree

6 files changed

+25
-6
lines changed

6 files changed

+25
-6
lines changed

β€Žservices/web/server/tests/unit/with_dbs/04/conftest.pyβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict
88

99

10+
@pytest.fixture(scope="session")
11+
def service_name() -> str:
12+
# Overrides service_name fixture needed in docker_compose_service_environment_dict fixture
13+
return "webserver"
14+
15+
1016
@pytest.fixture
1117
def app_environment(
1218
app_environment: dict[str, str], monkeypatch: pytest.MonkeyPatch

β€Žservices/web/server/tests/unit/with_dbs/04/functions/conftest.pyβ€Ž

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
)
2020
from models_library.functions import FunctionClass, SolverFunction
2121
from models_library.products import ProductName
22+
from models_library.rabbitmq_basic_types import RPCNamespace
23+
from pydantic import TypeAdapter
2224
from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict
2325
from pytest_simcore.helpers.postgres_tools import insert_and_get_row_lifespan
2426
from pytest_simcore.helpers.typing_env import EnvVarsDict
@@ -43,14 +45,9 @@
4345
from sqlalchemy.ext.asyncio import AsyncEngine
4446

4547

46-
@pytest.fixture(scope="session")
47-
def service_name() -> str:
48-
# Overrides service_name fixture needed in docker_compose_service_environment_dict fixture
49-
return "wb-api-server"
50-
51-
5248
@pytest.fixture
5349
def app_environment(
50+
service_name: str,
5451
rabbit_service: RabbitSettings,
5552
app_environment: EnvVarsDict,
5653
docker_compose_service_environment_dict: EnvVarsDict,
@@ -73,6 +70,10 @@ def app_environment(
7370

7471
settings = ApplicationSettings.create_from_envs()
7572
assert settings.WEBSERVER_RABBITMQ
73+
assert (
74+
TypeAdapter(RPCNamespace).validate_python(service_name)
75+
== settings.WEBSERVER_RPC_NAMESPACE
76+
)
7677

7778
return new_envs
7879

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# pylint:disable=unused-variable
2+
# pylint:disable=unused-argument
3+
# pylint:disable=redefined-outer-name
4+
5+
6+
import pytest
7+
8+
9+
@pytest.fixture(scope="session")
10+
def service_name() -> str:
11+
# Overrides service_name fixture needed in docker_compose_service_environment_dict fixture
12+
return "wb-api-server"

0 commit comments

Comments
Β (0)