mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-30 13:05:08 +00:00
refactor(api): build list, search and session services through one launch_served
This commit is contained in:
@@ -19,6 +19,7 @@ import pytest
|
||||
|
||||
import unshackle.commands.dl as dl_module
|
||||
from tests.admission import refusal
|
||||
from tests.remote.sessions import launch_session
|
||||
from tests.remote.unit.test_remote_service_helpers import _sent_create_data
|
||||
from unshackle.core import mux_step
|
||||
from unshackle.core.api import download_manager, handlers, key_policy
|
||||
@@ -835,7 +836,7 @@ def test_a_remote_session_puts_the_flag_in_the_service_ctx(monkeypatch: pytest.M
|
||||
|
||||
def fake_instantiate(parent_ctx: Any, *args: Any) -> object:
|
||||
seen["ctx"] = parent_ctx
|
||||
return object()
|
||||
return SimpleNamespace()
|
||||
|
||||
monkeypatch.setattr(key_policy, "load_service_config", lambda service: {})
|
||||
monkeypatch.setattr(handlers, "load_full_cdm", lambda *args: None)
|
||||
@@ -843,7 +844,7 @@ def test_a_remote_session_puts_the_flag_in_the_service_ctx(monkeypatch: pytest.M
|
||||
monkeypatch.setattr(handlers, "instantiate_service", fake_instantiate)
|
||||
data = {"generate_dv": True} if to_dv else {}
|
||||
|
||||
handlers.create_service_instance("EXAMPLE", "title", data, None, [], None)
|
||||
launch_session("EXAMPLE", "title", data)
|
||||
|
||||
assert seen["ctx"].params["generate_dv"] is to_dv
|
||||
|
||||
|
||||
Reference in New Issue
Block a user