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
@@ -6,7 +6,6 @@ Over ``--cdm-only`` the session runs on the client's own device and asks the ser
import asyncio
import json
import logging
import threading
from pathlib import Path
from types import SimpleNamespace
from typing import Any
@@ -262,24 +261,6 @@ async def test_the_server_stores_only_a_named_kid_no_local_vault_holds(server, c
]
async def test_the_server_answers_before_the_remote_vaults_take_the_keys(server, monkeypatch) -> None:
release = threading.Event()
real = server.remote.add_keys
def slow(service: str, kid_keys: dict) -> int:
release.wait(10)
return real(service, kid_keys)
monkeypatch.setattr(server.remote, "add_keys", slow)
await handlers.session_keys_handler({"track_id": "v2", "keys": {LICENSED.hex: KEY}}, "sess")
assert server.local.get_key(LICENSED, "EXAMPLE") == KEY
assert server.remote.get_key(LICENSED, "EXAMPLE") is None
release.set()
await settled()
assert server.remote.get_key(LICENSED, "EXAMPLE") == KEY
async def test_a_client_cannot_replace_a_content_key_a_local_vault_holds(server) -> None:
server.local.add_key("EXAMPLE", LICENSED, OTHER_KEY)
await handlers.session_keys_handler({"track_id": "v2", "keys": {LICENSED.hex: KEY}}, "sess")
@@ -288,13 +269,6 @@ async def test_a_client_cannot_replace_a_content_key_a_local_vault_holds(server)
assert server.remote.get_key(LICENSED, "EXAMPLE") is None
async def test_the_server_answers_empty_when_it_stores_nothing(server, caplog) -> None:
caplog.set_level(logging.INFO, logger="api")
resp = await handlers.session_keys_handler({"track_id": ["v1"], "keys": {UNNAMED.hex: KEY}}, "sess")
assert (resp.status, json.loads(resp.body)) == (200, {})
assert [r for r in caplog.records if r.levelno >= logging.INFO] == []
def cdm_only_client(monkeypatch: pytest.MonkeyPatch, tmp_path: Path, cdm: Any, created: dict) -> RemoteService:
"""A real RemoteService for a ``--cdm-only`` run whose server answers session create with ``created``."""
monkeypatch.setattr(config, "credentials", {})