refactor: migrate main.py to modular routers and add project roadmap
CI / Test (Python 3.11) (push) Has been cancelled
CI / Test (Python 3.12) (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Type Check (push) Has been cancelled
CI / Summary (push) Has been cancelled

- 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
This commit is contained in:
root
2026-03-24 10:12:04 +00:00
parent 1b5d7f9238
commit d4d8d8a3b6
42 changed files with 4518 additions and 2426 deletions
+64
View File
@@ -0,0 +1,64 @@
# 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 tests
- `integration` - test_api.py only
- `asyncio` - Auto-detected from coroutine functions
- `slow` - Manual: `@pytest.mark.slow`
- `network` - 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 folder
- `sample_download_task` - DownloadTask instance
- `mock_httpx_client` - Mocked AsyncClient
- `download_manager` - Pre-configured DownloadManager
**Run commands**:
- `pytest` - All tests with coverage
- `pytest -m "not slow"` - Skip slow tests
- `pytest --cov=app --cov-report=html` - HTML coverage report