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 -30
View File
@@ -1,19 +1,7 @@
from collections import Counter
import pytest
from pyplayready.misc.drmresults import DrmResult
from unshackle.core.drm.playready import PlayReady
from unshackle.core.drm.playready_errors import REVOCATION_CODES, describe, is_revocation
def test_only_oem_code_repeats_upstream() -> None:
counts = Counter(m.value[0] for m in DrmResult)
assert [code for code, n in counts.items() if n > 1] == [0x8004DFF]
def test_revocation_codes() -> None:
assert REVOCATION_CODES == {0x8004C065, 0x8004C053, 0x8004C07D}
from unshackle.core.drm.playready_errors import describe, is_revocation
@pytest.mark.parametrize("code", [0x8004C065, -2147172251, 0x8004C053, 0x8004C07D])
@@ -31,23 +19,6 @@ def test_describe_signed_and_unsigned() -> None:
assert describe(0x8004C065) == describe(-2147172251) == text
def test_describe_uses_upstream_name() -> None:
assert describe(0x8004C006) == "DRM_E_INVALID_LICENSE (0x8004C006): The license is invalid"
@pytest.mark.parametrize(
("code", "text"),
[
(0x80041100, "DRM_E_CH_BASECODE (0x80041100)"),
(0x80048000, "DRM_E_LEGACY_BASECODE (0x80048000)"),
(0x8004DFFC, "DRM_E_OEM_CONSTRAINT_1_FAIL (0x8004DFFC): Failed while OEM CONSTRAINT-1 check"),
(0x8004DFFF, "DRM_E_HDCP_NON_SECURE (0x8004DFFF): Attempt to play back through insecure HDMI output path"),
],
)
def test_describe_local_codes(code: int, text: str) -> None:
assert describe(code) == text
@pytest.mark.parametrize("code", [-1021, 0x08004DFF])
def test_describe_unknown(code: int) -> None:
assert describe(code) is None