refactor(drm): hand the server key batch to one installer as a KeyBatch value

This commit is contained in:
imSp4rky
2026-12-02 20:05:08 -07:00
parent fef6898823
commit 46a3bc0ad2
20 changed files with 379 additions and 265 deletions
+3 -2
View File
@@ -18,6 +18,7 @@ from uuid import UUID
import click
import pytest
from tests.core.key_resolver import install_batch
from unshackle.core.drm.clearkey import ClearKey
from unshackle.core.drm.clearkey_cenc import ClearKeyCENC
from unshackle.core.export_writer import ExportWriter
@@ -159,7 +160,7 @@ def test_post_download_write_keeps_licensed_keys(tmp_path: Path) -> None:
def test_drm_free_export_roundtrips_through_import_service(tmp_path: Path) -> None:
"""A DRM-free export must rebuild via ImportService: titles, tracks (no DRM),
empty key pool (resolve_server_keys no-op) and chapters."""
empty key pool (batch_keys answers nothing) and chapters."""
writer = make_writer(tmp_path)
title = make_title()
title.tracks.chapters.add(Chapter("00:00:10.000", "Intro"))
@@ -182,7 +183,7 @@ def test_drm_free_export_roundtrips_through_import_service(tmp_path: Path) -> No
assert svc.key_pool() == {}
movie.tracks = tracks
svc.resolve_server_keys(movie)
install_batch(svc, movie)
assert all(not t.drm for t in movie.tracks)
# Chapters.add auto-inserts a nameless 00:00:00 baseline chapter; it round-trips too.