mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-01 21:45:10 +00:00
fix(remote): end a remote session from before its create to after its DELETE
This commit is contained in:
@@ -14,7 +14,7 @@ import pytest
|
||||
from pywidevine import DeviceTypes
|
||||
from pywidevine.pssh import PSSH
|
||||
|
||||
from tests.remote.sessions import launch_session, session_entry
|
||||
from tests.remote.sessions import hold_session, launch_session, session_entry
|
||||
from unshackle.core.api import handlers, key_policy, server_keys
|
||||
from unshackle.core.api.errors import APIError
|
||||
from unshackle.core.api.input_bridge import InputBridge
|
||||
@@ -447,12 +447,8 @@ def test_a_lent_device_session_returns_no_cache_at_the_end(monkeypatch: pytest.M
|
||||
async def validated(session_id: str, request: Any) -> Any:
|
||||
return session
|
||||
|
||||
class Store:
|
||||
async def delete(self, session_id: str) -> bool:
|
||||
return True
|
||||
|
||||
monkeypatch.setattr(handlers, "get_validated_session", validated)
|
||||
monkeypatch.setattr(session_store, "get_session_store", lambda: Store())
|
||||
monkeypatch.setattr(session_store, "get_session_store", session_store.SessionStore)
|
||||
monkeypatch.setattr(handlers, "collect_cache_files", lambda tag, withhold=(): {"MSL/server-esn": "tokens"})
|
||||
|
||||
response = asyncio.run(handlers.session_delete_handler("sid", None))
|
||||
@@ -477,7 +473,7 @@ def test_a_lent_device_without_the_vault_grant_asks_the_server_for_no_key() -> N
|
||||
|
||||
svc = object.__new__(RemoteService)
|
||||
svc.log = logging.getLogger("test")
|
||||
svc._session_id = "sid"
|
||||
hold_session(svc, "sid")
|
||||
svc.licensing = LicensingMode(Licensor.LENT_DEVICE)
|
||||
svc.client_licensed = set()
|
||||
svc.deferred_refusals = {}
|
||||
|
||||
Reference in New Issue
Block a user