fix(remote): keep the server's own CDM when the tier licenses with server_cdm

This commit is contained in:
imSp4rky
2026-09-20 01:19:48 -06:00
parent 025499efa7
commit b8f00f6b95
3 changed files with 18 additions and 2 deletions
+14
View File
@@ -119,3 +119,17 @@ def test_validate_rejects_bad_region_values(accounts):
handlers.config.serve["server_accounts"]["EX"]["ca_main"] = "canada"
with pytest.raises(ValueError):
handlers.validate_server_accounts()
def test_server_cdm_ignores_client_cdm_type(monkeypatch):
"""A server_cdm tier licenses with the server's own device, so the client's CDM type must
not swap it for a stub of the other DRM system."""
seen = []
monkeypatch.setattr(handlers, "load_service_yaml", lambda s: {})
monkeypatch.setattr(handlers, "load_full_cdm", lambda s, p, t=None: seen.append(t))
monkeypatch.setattr(handlers.Services, "load", staticmethod(lambda s: object()))
monkeypatch.setattr(handlers, "instantiate_service", lambda *a: "svc")
data = {"cdm_type": "playready"}
handlers.create_service_instance("OTHER", "t", data, None, [], None, server_cdm=True)
handlers.create_service_instance("OTHER", "t", data, None, [], None)
assert seen == [None, "playready"]