test(dash): stub the ffprobe call in the init-segment pssh test so it runs without the binary

This commit is contained in:
imSp4rky
2026-11-28 21:47:27 -07:00
parent 0a791ad6e8
commit f4d178c26b
+2 -1
View File
@@ -20,7 +20,7 @@ from pywidevine.pssh import PSSH
from unshackle.core import binaries from unshackle.core import binaries
from unshackle.core.constants import DOWNLOAD_LICENCE_ONLY from unshackle.core.constants import DOWNLOAD_LICENCE_ONLY
from unshackle.core.drm import Widevine from unshackle.core.drm import Widevine, cenc
from unshackle.core.drm.clearkey_cenc import ClearKeyCENC from unshackle.core.drm.clearkey_cenc import ClearKeyCENC
from unshackle.core.manifests.dash import DASH from unshackle.core.manifests.dash import DASH
from unshackle.core.tracks.track import DownloadContext from unshackle.core.tracks.track import DownloadContext
@@ -144,6 +144,7 @@ def test_download_track_prefers_the_init_segment_pssh_over_a_common_pssh(tmp_pat
track = DASH.from_text(COMMON_MPD, MANIFEST_URL).to_tracks().videos[0] track = DASH.from_text(COMMON_MPD, MANIFEST_URL).to_tracks().videos[0]
monkeypatch.setattr(track, "get_key_id", lambda *args, **kwargs: KID) monkeypatch.setattr(track, "get_key_id", lambda *args, **kwargs: KID)
monkeypatch.setattr(binaries, "FFProbe", Path("ffprobe")) monkeypatch.setattr(binaries, "FFProbe", Path("ffprobe"))
monkeypatch.setattr(cenc, "ffprobe", lambda data: {})
with_init(monkeypatch, base64.b64decode(PSSH.new(system_id=PSSH.SystemId.Widevine, key_ids=[KID]).dumps())) with_init(monkeypatch, base64.b64decode(PSSH.new(system_id=PSSH.SystemId.Widevine, key_ids=[KID]).dumps()))
licence = licence_only(track, tmp_path) licence = licence_only(track, tmp_path)