fix tests
This commit is contained in:
@@ -8,6 +8,7 @@ concurrent requests and maintain acceptable response times.
|
||||
import asyncio
|
||||
import time
|
||||
from typing import Any, Dict, List
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
import pytest
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
@@ -20,6 +21,22 @@ from src.server.fastapi_app import app
|
||||
class TestAPILoadTesting:
|
||||
"""Load testing for API endpoints."""
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_series_app_dependency(self):
|
||||
"""Mock SeriesApp dependency for performance tests."""
|
||||
from src.server.utils.dependencies import get_series_app
|
||||
|
||||
mock_app = MagicMock()
|
||||
mock_app.list = MagicMock()
|
||||
mock_app.list.GetMissingEpisode = MagicMock(return_value=[])
|
||||
mock_app.search = AsyncMock(return_value=[])
|
||||
|
||||
app.dependency_overrides[get_series_app] = lambda: mock_app
|
||||
|
||||
yield
|
||||
|
||||
app.dependency_overrides.clear()
|
||||
|
||||
@pytest.fixture
|
||||
async def client(self):
|
||||
"""Create async HTTP client."""
|
||||
|
||||
Reference in New Issue
Block a user