Skip to content

Commit 25ca3d7

Browse files
committed
fixed test
1 parent 8b3ea61 commit 25ca3d7

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

services/dynamic-sidecar/tests/unit/conftest.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@
3131
logger = logging.getLogger(__name__)
3232

3333

34-
#
35-
# APP and CLIENT fixtures
36-
#
37-
# In this context by default all external services are
38-
# mocked (e.g. registry, rabbitmq, ...)
39-
#
40-
#
41-
42-
4334
@pytest.fixture
4435
def app(
4536
postgres_db: sa.engine.Engine,

services/dynamic-sidecar/tests/unit/test_api_rpc__disk_usage.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from unittest.mock import AsyncMock
77

88
import pytest
9+
import sqlalchemy as sa
910
from asgi_lifespan import LifespanManager
1011
from fastapi import FastAPI
1112
from models_library.api_schemas_dynamic_sidecar.telemetry import DiskUsage
@@ -15,6 +16,7 @@
1516
from servicelib.rabbitmq.rpc_interfaces.dynamic_sidecar import disk_usage
1617
from settings_library.rabbit import RabbitSettings
1718
from settings_library.redis import RedisSettings
19+
from simcore_service_dynamic_sidecar.core.application import create_app
1820
from simcore_service_dynamic_sidecar.core.settings import ApplicationSettings
1921
from simcore_service_dynamic_sidecar.modules.system_monitor._disk_usage import (
2022
get_disk_usage_monitor,
@@ -33,27 +35,25 @@
3335

3436
@pytest.fixture
3537
def mock_environment(
38+
mock_environment: EnvVarsDict,
3639
monkeypatch: pytest.MonkeyPatch,
3740
rabbit_service: RabbitSettings,
3841
redis_service: RedisSettings,
39-
mock_environment: EnvVarsDict,
4042
mock_registry_service: AsyncMock,
4143
) -> EnvVarsDict:
4244
return setenvs_from_dict(
4345
monkeypatch,
4446
{
4547
"DY_SIDECAR_SYSTEM_MONITOR_TELEMETRY_ENABLE": "true",
46-
"RABBIT_HOST": rabbit_service.RABBIT_HOST,
47-
"RABBIT_PASSWORD": rabbit_service.RABBIT_PASSWORD.get_secret_value(),
48-
"RABBIT_PORT": f"{rabbit_service.RABBIT_PORT}",
49-
"RABBIT_SECURE": f"{rabbit_service.RABBIT_SECURE}",
50-
"RABBIT_USER": rabbit_service.RABBIT_USER,
5148
},
5249
)
5350

5451

5552
@pytest.fixture
56-
async def app(app: FastAPI, mock_environment: EnvVarsDict) -> AsyncIterable[FastAPI]:
53+
async def app(
54+
postgres_db: sa.engine.Engine, mock_environment: EnvVarsDict
55+
) -> AsyncIterable[FastAPI]:
56+
app = create_app()
5757
async with LifespanManager(app):
5858
yield app
5959

0 commit comments

Comments
 (0)