fix(remote): end every remote wait of a run when the user cancels it

This commit is contained in:
imSp4rky
2026-11-30 19:59:26 -07:00
parent b826eccb86
commit b907069eb5
13 changed files with 873 additions and 42 deletions
+13
View File
@@ -13,6 +13,7 @@ from pyplayready.system.wrmheader import WRMHeader
from pywidevine.key import Key as WidevineKey
from unshackle.core.cdm.http_cdm import HttpCdm
from unshackle.core.constants import DownloadCancelled
from unshackle.core.drm import PlayReady
KID_A = UUID("00112233-4455-6677-8899-aabbccddeeff")
@@ -196,6 +197,18 @@ def test_a_refused_header_does_not_lose_the_keys_of_the_others() -> None:
assert drm.content_keys == {KID_B: KEY_B}
def test_a_licence_that_the_user_cancelled_is_no_refusal() -> None:
drm = _drm(_wrm_header(KID_A), _wrm_header(KID_B))
cdm = FakeCdm({KID_B: KEY_B})
def cancel(**_: Any) -> str:
raise DownloadCancelled
with pytest.raises(DownloadCancelled):
drm.get_content_keys(cdm=cdm, certificate=_cert, licence=cancel)
assert cdm.attempted == [[KID_A]]
def test_every_header_refused_raises() -> None:
drm = _drm(_wrm_header(KID_A), _wrm_header(KID_B))
cdm = FakeCdm({}, fail_on={KID_A, KID_B})