Add admin panel, WebSocket support, and API versioning
Introduce an admin portal (React + Nginx), WebSocket routing, and API versioning middleware with `/api/v1/` prefix deprecation. Add master API key authentication, new Prometheus metrics for AI token consumption and active WebSockets, and extend S3 config with a public endpoint URL. Update test paths and fixtures to align with the new routing structure.
This commit is contained in:
+9
-7
@@ -55,7 +55,7 @@ app.dependency_overrides[get_db] = override_get_db
|
||||
# Mock ARQ pool et Redis pour les tests (pas de Redis requis)
|
||||
# ─────────────────────────────────────────────────────────────
|
||||
|
||||
from unittest.mock import AsyncMock
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
_mock_arq_pool = AsyncMock()
|
||||
_mock_arq_pool.enqueue_job = AsyncMock(return_value=None)
|
||||
@@ -75,12 +75,14 @@ app.state.redis = _mock_redis
|
||||
|
||||
@pytest_asyncio.fixture(autouse=True)
|
||||
async def setup_database():
|
||||
"""Crée et détruit toutes les tables avant/après chaque test."""
|
||||
async with test_engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
yield
|
||||
async with test_engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.drop_all)
|
||||
"""Crée et détruit toutes les tables avant/après chaque test. Patch also STORAGE_BACKEND."""
|
||||
with patch("app.services.storage.settings.STORAGE_BACKEND", "local"), \
|
||||
patch("app.config.settings.STORAGE_BACKEND", "local"):
|
||||
async with test_engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
yield
|
||||
async with test_engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.drop_all)
|
||||
|
||||
|
||||
@pytest_asyncio.fixture
|
||||
|
||||
Reference in New Issue
Block a user