test: delete slow, timing-based and redundant tests

This commit is contained in:
imSp4rky
2026-12-05 15:20:05 -07:00
parent 783a2fc185
commit 3a0a74e694
292 changed files with 153 additions and 15174 deletions
+1 -44
View File
@@ -20,7 +20,7 @@ from unshackle.core.config import config
from unshackle.core.drm import ClearKeyCENC
from unshackle.core.drm import decrypters as decrypters_module
from unshackle.core.drm.decrypters import mp4decrypt_or_shaka
from unshackle.core.drm.key_args import shaka_noise, track_key_args
from unshackle.core.drm.key_args import track_key_args
from unshackle.core.drm.segment_decrypt import SegmentDecrypter, can_use
from unshackle.core.drm.verify import kidless_track_kids
from unshackle.core.remote_protocol import APIErrorCode
@@ -355,21 +355,6 @@ def test_shaka_error_line_with_exit_0_is_a_decrypt(
assert path.read_bytes() == b"decrypted"
@POSIX_STUBS
@pytest.mark.parametrize("make", DRMS)
def test_shaka_non_zero_exit_raises(
tmp_path: Path, stub_packager: Callable[[int], None], make: Callable[[], Any]
) -> None:
stub_packager(2)
path = tmp_path / "track.mp4"
path.write_bytes(b"encrypted")
drm = make()
drm.content_keys[A] = KEY
with pytest.raises(subprocess.CalledProcessError):
drm.decrypt_with_shaka_packager(path)
class FakePackager:
"""A shaka-packager Popen that records its argv, prints ``log`` and exits with ``code``."""
@@ -407,13 +392,6 @@ def shaka_run(tmp_path: Path, make: Callable[[], Any], raises: type[BaseExceptio
return caught.value
@pytest.mark.parametrize("make", DRMS)
@pytest.mark.usefixtures("fake_packager")
def test_every_drm_passes_the_fake_clock(tmp_path: Path, make: Callable[[], Any]) -> None:
shaka_run(tmp_path, make, FileNotFoundError)
assert "--use_fake_clock_for_muxer" in FakePackager.argv
@pytest.mark.usefixtures("fake_packager")
def test_clearkey_gives_no_zero_kid_fallback(tmp_path: Path) -> None:
shaka_run(tmp_path, lambda: ClearKeyCENC(kids=[A]), FileNotFoundError)
@@ -456,24 +434,3 @@ def test_a_skipped_shaka_stream_keeps_the_input(tmp_path: Path, make: Callable[[
def test_a_shaka_ctrl_c_exit_is_a_keyboard_interrupt(tmp_path: Path) -> None:
FakePackager.code = 0xC000013A
shaka_run(tmp_path, lambda: _widevine(A), KeyboardInterrupt)
@pytest.mark.parametrize(
("line", "noise"),
[
pytest.param(
"I1103 21:41:56.557273 16212 packager_main.cc:591] Excluding 'pssh' boxes", True, id="glog-info"
),
pytest.param("I0503 01:02:03.000000 1 demuxer.cc:105] Demuxer::Run()", True, id="glog-info-early-month"),
pytest.param("W1103 21:41:56.000000 1 x.cc:1] warning", True, id="glog-warning"),
pytest.param(
"[1103/214121:WARNING:track_run_iterator.cc(699)] Seeing non-zero composition offset", True, id="warning"
),
pytest.param("[1103/153402:INFO:demuxer.cc(170)] Initialize Demuxer", True, id="info"),
pytest.param("[1103/153402:ERROR:box_definitions.cc(641)] Not implemented reached", False, id="error"),
pytest.param("E1103 21:41:56.000000 1 x.cc:1] failed", False, id="glog-error"),
pytest.param("Packaging completed successfully.", False, id="plain"),
],
)
def test_shaka_noise(line: str, noise: bool) -> None:
assert shaka_noise(line) is noise