mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-13 12:35:05 +00:00
refactor(api): dedup handler serializers, validation, and service setup
Collapse repeated serializer/validation/CDM/list-setup logic in handlers.py behind small helpers; output behaviour unchanged.
This commit is contained in:
@@ -199,6 +199,22 @@ def test_serialize_drm_widevine_minimal() -> None:
|
||||
assert info["license_url"] == "https://lic.example.com/wv"
|
||||
|
||||
|
||||
def test_serialize_drm_playready_pssh_without_dumps_is_omitted() -> None:
|
||||
# pyplayready's PSSH exposes no dumps()/to_base64()/__bytes__; serialization
|
||||
# must omit the pssh field rather than emit an object repr.
|
||||
class _PSSH:
|
||||
pass
|
||||
|
||||
class _PlayReady:
|
||||
def __init__(self) -> None:
|
||||
self._pssh = _PSSH()
|
||||
self.kids = ["00112233445566778899aabbccddeeff"]
|
||||
|
||||
info = serialize_drm(_PlayReady())[0]
|
||||
assert "pssh" not in info
|
||||
assert info["kids"] == ["00112233445566778899aabbccddeeff"]
|
||||
|
||||
|
||||
# ---------- validate_service ----------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user