d4d8d8a3b6
- Migrated monolithic main.py to feature-scoped routers in app/routers/ - Added GEMINI.md for project context and AI instructional guidelines - Updated README.md with a comprehensive modernization plan (SQL migration, robust scraping DSL, frontend modernization) - Improved authentication with cookie support and modular JS - Updated test suite and documentation
2.2 KiB
2.2 KiB
AGENTS.md - Test Suite
OVERVIEW
Pytest test suite for Ohm Stream Downloader with 18 test files covering unit and integration tests.
STRUCTURE
tests/
├── conftest.py # Fixtures & pytest config
├── test_*.py # 18 test modules
├── test_api.py # FastAPI endpoints (integration)
├── test_auth.py # JWT authentication
├── test_download_manager.py # Download queue management
├── test_downloaders.py # Provider downloaders
├── test_anime_sama_*.py # Anime-Sama provider variants
├── test_favorites.py # Favorites management
├── test_french_manga.py # French-Manga provider
├── test_models.py # Pydantic model validation
├── test_sonarr.py # Sonarr webhook integration
├── test_utils.py # Utility functions
├── test_watchlist.py # Auto-download watchlist
├── test_metadata_enrichment.py
├── test_translate_api.py
├── test_delete_and_restore.py
WHERE TO LOOK
| Need | File |
|---|---|
| Run all tests | pytest |
| Unit tests only | pytest -m "unit" |
| Integration tests | pytest -m "integration" (test_api.py auto-marked) |
| 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
Naming:
- Files:
test_*.py - Classes:
Test*(e.g.,class TestSanitizeFilename:) - Functions:
test_*(e.g.,def test_sanitize_simple_filename(self):)
Fixtures (in conftest.py):
temp_dir- Temporary directory (auto-cleanup)temp_download_dir- Download foldersample_download_task- DownloadTask instancemock_httpx_client- Mocked AsyncClientdownload_manager- Pre-configured DownloadManager
Run commands:
pytest- All tests with coveragepytest -m "not slow"- Skip slow testspytest --cov=app --cov-report=html- HTML coverage report