3dc5dd8fe9
- Fix register/login: dict-style access on UserTable ORM objects - Fix HTMX auth: inject JWT token in all HTMX request headers - Fix FS7 search: use DLE AJAX endpoint /engine/ajax/search.php - Fix ZT search: use ?p=series&search=QUERY (not DLE format) - Fix provider health: load hardcoded providers + domain manager - Add self.id to all anime/series providers - Redesign homepage: Netflix-style horizontal scroll cards (.hc) - Redesign search results: grouped by title, poster + synopsis + 3 buttons - Add Télécharger dropdown: season download + episode picker - Fix navbar CSS: restore .tabs flex layout, remove orphan rules - Fix HTMX spinner: remove inline display:none, use CSS indicator - Add AGENTS.md files across project for developer documentation
2.3 KiB
2.3 KiB
AGENTS.md - Test Suite
OVERVIEW
Pytest suite: 18+ test files, 5000+ lines. Auto-marked (unit/integration/asyncio) + manual markers (slow/network).
STRUCTURE
tests/
├── conftest.py # 301 lines: fixtures, markers, DB isolation, event loop
├── e2e/ # Playwright end-to-end tests
├── test_api.py # 627 lines — FastAPI endpoints (auto integration)
├── test_favorites.py # 564 lines — Favorites CRUD
├── test_sonarr.py # 513 lines — Sonarr webhook
├── test_metadata_enrichment.py # 442 lines — Kitsu API
├── test_download_manager.py # 395 lines — Download queue
├── test_downloaders.py # 341 lines — Provider scrapers
├── test_models.py # 321 lines — Pydantic models
├── test_utils.py # 246 lines — sanitize_filename, is_safe_filename
└── test_watchlist.py # 178 lines — Auto-download watchlist
Root-level tests (legacy placement, NOT in tests/):
test_watchlist_simple.py,test_watchlist_e2e.py— should be moved to tests/
WHERE TO LOOK
| Need | File |
|---|---|
| All tests | pytest |
| Unit only | pytest -m "unit" |
| Integration only | pytest -m "integration" (test_api.py auto-marked) |
| Skip slow | pytest -m "not slow" |
| Download logic | test_download_manager.py, test_downloaders.py |
| API endpoints | test_api.py |
| Provider scrapers | test_anime_sama_*.py, test_french_manga.py |
CONVENTIONS
Markers (auto-applied unless manual):
unit— Default for non-api testsintegration— test_api.py onlyasyncio— Auto-detected from coroutine functionsslow— Manual:@pytest.mark.slownetwork— Manual:@pytest.mark.network
DB isolation: conftest.py forces DATABASE_URL=sqlite:// in-memory. Tables auto-drop/recreate per test.
Naming: Files test_*.py, classes Test*, functions test_*.
Config: pytest.ini — asyncio_mode=auto, timeout=300s, coverage on app/.
ANTI-PATTERNS
- Do NOT add network-dependent tests without
@pytest.mark.network - Do NOT add slow tests without
@pytest.mark.slow - Empty
except:intest_api.py:429,451andtest_download_manager.py:357— known tech debt