| … | … | @@ -129,9 +129,18 @@ def test_never_returns_an_empty_ladder(): |
| 129 | 129 | # --- the route -------------------------------------------------------------- |
| 130 | 130 | |
| 131 | 131 | @pytest.fixture |
| 132 | | def client(monkeypatch): |
| 132 | def client(monkeypatch, tmp_path): |
| 133 | 133 | monkeypatch.setattr(addon, "_resolve_vidcore", lambda *a, **k: MASTER_URL) |
| 134 | 134 | monkeypatch.setattr(addon, "_prefetch_vidcore", lambda *a, **k: None) |
| 135 | # The route checks for a local copy BEFORE resolving, so without these the |
| 136 | # test depends on the developer's disk: tmdb:138502 S02E07 is a real file in |
| 137 | # the real mp4-cache on the machine this was written on, and h=720 found it |
| 138 | # and redirected to /mp4/ instead of the variant. Working out the library |
| 139 | # path also reaches TMDB over the network, from a unit test. |
| 140 | monkeypatch.setattr(addon, "MP4_DIR", str(tmp_path / "cache")) |
| 141 | monkeypatch.setattr(addon, "LIBRARY_ROOT", str(tmp_path / "lib")) |
| 142 | monkeypatch.setattr(addon, "_library_meta", lambda *a, **k: None) |
| 143 | monkeypatch.setattr(addon, "_ensure_ingest", lambda *a, **k: None) |
| 135 | 144 | return addon.app.test_client() |
| 136 | 145 | |
| 137 | 146 | |