fixed : tests
This commit is contained in:
@@ -50,6 +50,20 @@ class FakeSeriesApp:
|
||||
if not any(s.key == serie.key for s in self._items):
|
||||
self._items.append(serie)
|
||||
|
||||
async def search(self, query):
|
||||
"""Search for series (async)."""
|
||||
# Return mock search results
|
||||
return [
|
||||
{
|
||||
"key": "test-result",
|
||||
"name": "Test Search Result",
|
||||
"site": "aniworld.to",
|
||||
"folder": "test-result",
|
||||
"link": "https://aniworld.to/anime/test",
|
||||
"missing_episodes": {},
|
||||
}
|
||||
]
|
||||
|
||||
def refresh_series_list(self):
|
||||
"""Refresh series list."""
|
||||
pass
|
||||
@@ -65,6 +79,20 @@ def reset_auth_state():
|
||||
auth_service._failed.clear()
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_series_app_dependency():
|
||||
"""Override the series_app dependency with FakeSeriesApp."""
|
||||
from src.server.utils.dependencies import get_series_app
|
||||
|
||||
fake_app = FakeSeriesApp()
|
||||
app.dependency_overrides[get_series_app] = lambda: fake_app
|
||||
|
||||
yield fake_app
|
||||
|
||||
# Clean up
|
||||
app.dependency_overrides.clear()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def authenticated_client():
|
||||
"""Create authenticated async client."""
|
||||
|
||||
Reference in New Issue
Block a user