mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-26 19:05:13 +00:00
refactor(api): answer every API key question from one KeyPolicy
This commit is contained in:
@@ -55,7 +55,7 @@ def cli_search(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> click.Context
|
||||
|
||||
def rest_handlers(monkeypatch: pytest.MonkeyPatch) -> tuple[Any, dict]:
|
||||
"""The handlers module with the service, its config, CDM and proxy stubbed, and the context it builds."""
|
||||
from unshackle.core.api import handlers
|
||||
from unshackle.core.api import handlers, key_policy
|
||||
|
||||
seen: dict = {}
|
||||
|
||||
@@ -63,7 +63,7 @@ def rest_handlers(monkeypatch: pytest.MonkeyPatch) -> tuple[Any, dict]:
|
||||
seen["ctx"] = parent_ctx
|
||||
return SimpleNamespace(authenticate=lambda cookies, credential: None)
|
||||
|
||||
monkeypatch.setattr(handlers, "load_service_config", lambda tag: {})
|
||||
monkeypatch.setattr(key_policy, "load_service_config", lambda tag: {})
|
||||
monkeypatch.setattr(handlers, "resolve_handler_proxy", lambda *a: (None, []))
|
||||
monkeypatch.setattr(handlers, "load_full_cdm", lambda *a: None)
|
||||
monkeypatch.setattr(handlers.Services, "load", lambda tag: SimpleNamespace())
|
||||
|
||||
Reference in New Issue
Block a user