feat(drm)!: load DRM systems beyond the built-ins from plugins in directories.plugins

This commit is contained in:
imSp4rky
2026-12-03 15:51:42 -07:00
parent f8a248a29e
commit e9adc50594
65 changed files with 1651 additions and 2526 deletions
+16 -1
View File
@@ -11,7 +11,7 @@ from typing import Any
import pytest
from unshackle.core import binaries, console, process_exit
from unshackle.core import binaries, console, plugins, process_exit
from unshackle.core import session as http_session
from unshackle.core.config import config
from unshackle.core.constants import DOWNLOAD_LICENCE_ONLY, RunCancel
@@ -108,6 +108,21 @@ def no_dl_run_state(monkeypatch: pytest.MonkeyPatch) -> None:
DOWNLOAD_LICENCE_ONLY.clear()
@pytest.fixture(autouse=True)
def no_drm_plugins(monkeypatch: pytest.MonkeyPatch) -> None:
"""Start with an empty DRM plugin registry, whatever the local plugin folder holds."""
monkeypatch.setattr(plugins, "PLUGINS", {})
@pytest.fixture
def example_plugins(monkeypatch: pytest.MonkeyPatch) -> None:
"""Load the EXAMPLE and OTHER test DRM plugins (tests/drm_plugins.py) as the only plugins."""
from tests.drm_plugins import EXAMPLE, FINISHED, OTHER
FINISHED.clear()
monkeypatch.setattr(plugins, "PLUGINS", {EXAMPLE.id: EXAMPLE, OTHER.id: OTHER})
@pytest.fixture(autouse=True)
def no_speed_limit(monkeypatch: pytest.MonkeyPatch) -> None:
"""Start with no speed limit, so a limit that an earlier test locked cannot block a later one."""