mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-14 21:15:06 +00:00
test: install the EXAMPLE service through a fixture, not the live config
Two tests failed when the local unshackle.yaml left out the in-repo services folder.
This commit is contained in:
@@ -69,6 +69,17 @@ def no_speed_limit(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(requests_downloader, "speed_limit_locked", False)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def example_service(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Make the in-repo EXAMPLE the only installed service, whatever the local unshackle.yaml lists."""
|
||||
from unshackle.core import services
|
||||
|
||||
path = config.directories.namespace_dir / "services" / "EXAMPLE" / "__init__.py"
|
||||
monkeypatch.setattr(services, "SERVICES", [path])
|
||||
monkeypatch.setattr(services, "MODULES", {})
|
||||
monkeypatch.setattr(services, "LOAD_ERRORS", [])
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mux_args(monkeypatch: pytest.MonkeyPatch) -> Callable[..., list[str]]:
|
||||
"""Run Tracks.mux up to mkvmerge and return its arguments; ``ids`` is what the track ID probe reports."""
|
||||
|
||||
Reference in New Issue
Block a user