This commit is contained in:
team3
2026-09-30 00:59:59 +02:00
parent 7bf9667007
commit c589e389df
20 changed files with 1814 additions and 29 deletions

View File

@@ -10,6 +10,7 @@ from pathlib import Path
_ORDNER = Path(tempfile.mkdtemp(prefix="filmabend-tests-"))
os.environ["DB_PATH"] = str(_ORDNER / "test.db")
os.environ["CLIPS_DIR"] = str(_ORDNER / "clips")
os.environ.setdefault("TMDB_TOKEN", "test")
os.environ.setdefault("MINIMAX_KEY", "test")
# Der Hostmodus hängt am Schlüssel — in den Tests ein fester
@@ -18,7 +19,7 @@ os.environ["HOST_SCHLUESSEL"] = "test-host-schluessel"
import pytest # noqa: E402
from fastapi.testclient import TestClient # noqa: E402
from app import db, features, main, suggestions, users, watched, wishlist # noqa: E402
from app import clips, db, features, main, suggestions, users, watched, wishlist # noqa: E402
# Zählt, ob der Startup doch einen Sync anstoßen wollte
_SYNC_AUFRUFE = []
@@ -49,7 +50,7 @@ def sync_aufrufe():
def frische_db(app_start):
"""Jeder Test beginnt mit leeren Tabellen und ohne laufende Ziehung."""
db.DB_PATH.unlink(missing_ok=True)
for modul in (db, users, suggestions, watched, wishlist, features):
for modul in (db, users, suggestions, watched, clips, wishlist, features):
modul.init()
main.letzter_dreh.update(ergebnis=None, start=0.0)