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
+20
View File
@@ -197,6 +197,26 @@ def test_a_refused_licence_without_the_track_key_reports_the_licence_error(
assert "Licence request failed" in str(tree.children[-1].label)
@pytest.mark.parametrize("all_drm", [False, True])
def test_a_licence_that_the_user_cancelled_shows_no_error(
monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture, all_drm: bool
) -> None:
def cancel(self: Widevine, **_: Any) -> None:
raise DownloadCancelled
monkeypatch.setattr(Widevine, "get_content_keys", cancel)
keys = resolver(best_available=True)
keys.all_drm_warned.add("PlayReady")
ContentKeyResolver.LICENSE_KEY_CACHE[KID_B] = KEYS[KID_B]
table = key_table()
with pytest.raises(DownloadCancelled):
prepare(keys, widevine(KID_A, KID_B), None, table, all_drm)
assert not [r for r in caplog.records if r.levelname == "WARNING"]
assert list(table.columns[0].cells) == [""]
def test_a_held_track_key_needs_no_licence(licences: Licences) -> None:
keys = resolver()
ContentKeyResolver.LICENSE_KEY_CACHE[KID_A] = KEYS[KID_A]