mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-03 22:45:09 +00:00
refactor(drm): hand the server key batch to one installer as a KeyBatch value
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user