mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-01 21:45:10 +00:00
fix(remote): end every remote wait of a run when the user cancels it
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user