mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-04 06:55:09 +00:00
feat(drm)!: load DRM systems beyond the built-ins from plugins in directories.plugins
This commit is contained in:
+16
-1
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user