🔧 MakeMKV: HOME=/config pour la cle d'activation persistante + erreur d'activation explicite
This commit is contained in:
1 parent
8e76fb7112
commit
acc1609b4d
4 files changed
+78
-1
No files matched your search
@@ -7,6 +7,7 @@ from fastapi.testclient import TestClient
|
||||
from httpx import Response
|
||||
|
||||
from app.config import settings
|
||||
from app.converter import extract_mkv
|
||||
from app.database import SessionLocal
|
||||
from app.main import app
|
||||
from app.models import IsoMovie
|
||||
@@ -161,3 +162,36 @@ def test_scan_marks_missing_radarr_files_as_unlinked() -> None:
|
||||
movie = client.get("/api/movies").json()[0]
|
||||
assert movie["radarr_linked"] is False
|
||||
assert movie["status"] == "detected"
|
||||
|
||||
|
||||
def test_extract_fails_with_activation_error_when_makemkv_unactivated(
|
||||
monkeypatch, tmp_path
|
||||
) -> None:
|
||||
"""Sans cle MakeMKV (message shareware), l'erreur guide vers l'activation."""
|
||||
from types import SimpleNamespace
|
||||
|
||||
monkeypatch.setattr(settings, "simulate_conversion", False)
|
||||
monkeypatch.setattr("app.converter.shutil.which", lambda _: "/usr/bin/makemkvcon")
|
||||
monkeypatch.setattr(
|
||||
"app.converter.subprocess.run",
|
||||
lambda *args, **kwargs: SimpleNamespace(
|
||||
returncode=10,
|
||||
stdout=(
|
||||
"This functionality is shareware. You may evaluate it for 30 days "
|
||||
"after what you would need to purchase an activation key.\n"
|
||||
"Do you want to start evaluation period now?\n"
|
||||
"Evaluation version, 30 day(s) out of 30 remaining"
|
||||
),
|
||||
stderr="",
|
||||
),
|
||||
)
|
||||
movie = IsoMovie(
|
||||
radarr_movie_id=1, radarr_movie_file_id=2, title="ISO Movie", path="/x.iso"
|
||||
)
|
||||
try:
|
||||
extract_mkv(movie, tmp_path / "out" / "movie.mkv")
|
||||
except RuntimeError as error:
|
||||
assert "MakeMKV n'est pas activé" in str(error)
|
||||
assert "makemkvcon reg" in str(error)
|
||||
else:
|
||||
raise AssertionError("RuntimeError attendue")
|
||||
Reference in new issue
Block a user