20 lines
845 B
Python
20 lines
845 B
Python
import os
|
|
import tempfile
|
|
from pathlib import Path
|
|
|
|
_test_config = Path(tempfile.mkdtemp(prefix="mkvtool-tests-"))
|
|
os.environ["MKVTOOL_CONFIG_DIR"] = str(_test_config)
|
|
os.environ["MKVTOOL_FILMS_DIR"] = str(_test_config / "films")
|
|
os.environ["MKVTOOL_RADARR_FILMS_DIR"] = str(_test_config / "radarr")
|
|
os.environ["MKVTOOL_DOWNLOADS_DIR"] = str(_test_config / "downloads")
|
|
os.environ["MKVTOOL_SIMULATE_CONVERSION"] = "true"
|
|
os.environ["MKVTOOL_WORKER_INTERVAL"] = "0.05"
|
|
|
|
# Tables creees des l'import des tests: les modules qui touchent la base
|
|
# sans demarrer l'application (SessionLocal directe) restent utilisables
|
|
# meme executes seuls (pytest tests/test_conversion.py).
|
|
from app import models # noqa: E402,F401 - modeles; import apres l'environnement
|
|
from app.database import Base, engine # noqa: E402
|
|
|
|
Base.metadata.create_all(bind=engine)
|