Files
ohm_streaming/tests
Kimi Agent 520be53901
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
fix: migrations, auth, providers health check, E2E tests, remove neko-sama
- Add proper Alembic initial migration (0001_initial_schema.py)
- Migrate refresh tokens from JSON file to SQLite (RefreshTokenTable)
- Remove Neko-Sama provider entirely (redirects to Gupy, not a host)
- Fix provider health check always showing UNKNOWN
  - Run check_all_health() on startup
  - Fix POST /providers/health/check background task bug
  - Add HTMX refresh after manual health check trigger
- Fix anime search relevance scoring with MIN_RELEVANCE_THRESHOLD=0.5
- Replace bare 'except:' with 'except Exception:' across codebase
- Add Playwright E2E test suite (12 tests, auth setup, helpers)
- Fix toast container blocking clicks via pointer-events: none
- Remove obsolete Jest/Vite test files and config
- Clean up obsolete test_watchlist scripts
- Update sonarr model comment for active providers
2026-05-12 11:45:56 +00:00
..

Tests pour Ohm Stream Downloader

Ce dossier contient la suite de tests unitaires pour le projet Ohm Stream Downloader.

Structure

tests/
├── __init__.py              # Package initialization
├── conftest.py              # Pytest configuration et fixtures
├── test_models.py           # Tests pour les modèles Pydantic
├── test_downloaders.py      # Tests pour les downloaders
├── test_download_manager.py # Tests pour DownloadManager
├── test_favorites.py        # Tests pour le système de favoris
└── test_api.py              # Tests pour les endpoints FastAPI

Lancer les tests

Tous les tests

pytest

Avec couverture de code

pytest --cov=app --cov-report=html

Uniquement les tests unitaires (rapides)

pytest -m "unit"

Uniquement les tests d'intégration

pytest -m "integration"

Exclure les tests lents

pytest -m "not slow"

Mode verbeux

pytest -v

Afficher le print debugging

pytest -s

Fixtures disponibles

Les fixtures sont définies dans conftest.py :

  • temp_dir : Répertoire temporaire pour les tests
  • temp_download_dir : Répertoire de téléchargement temporaire
  • sample_download_task : Exemple de tâche de téléchargement
  • sample_download_request : Exemple de requête de téléchargement
  • download_manager : Instance de DownloadManager configurée
  • favorites_manager : Instance de FavoritesManager configurée
  • mock_httpx_client : Mock pour httpx.AsyncClient
  • sample_anime_metadata : Exemple de métadonnées anime
  • sample_favorite_data : Exemple de favori

Marqueurs (Markers)

Les tests sont marqués automatiquement :

  • unit : Tests unitaires (isolés, rapides)
  • integration : Tests d'intégration (API endpoints)
  • asyncio : Tests asynchrones
  • slow : Tests lents (à marquer manuellement)
  • network : Tests nécessitant un accès réseau

Couverture de code

Le rapport de couverture est généré dans htmlcov/index.html après avoir lancé :

pytest --cov=app --cov-report=html

Notes

  • Les tests utilisent des mocks pour éviter les appels réseau réels
  • Les fichiers temporaires sont nettoyés automatiquement après chaque test
  • La base de données de favoris utilise des fichiers temporaires
  • Les tests asynchrones utilisent pytest-asyncio