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
-26
View File
@@ -2,11 +2,8 @@
from __future__ import annotations
from typing import Any
import pytest
from tests.core.test_manifest_corpus import CORPUS, INDEX, KNOWN_FAILURES, parse
from unshackle.core.manifests import DASH
from unshackle.core.utils.xml import load_xml
@@ -140,26 +137,3 @@ def test_non_integer_bandwidth_does_not_raise():
f'<AdaptationSet id="1" contentType="video">{video("v1", "5e6")}</AdaptationSet>',
)
assert resolve(mpd, 0, "v1") == (None, "v1", "avc1.640028")
def multi_period(entry: dict[str, Any]) -> bool:
periods = load_xml((CORPUS / entry["file"]).read_bytes()).findall("Period")
return sum(DASH.is_content_period(p, []) for p in periods) > 1
@pytest.mark.parametrize(
"entry",
[e for e in INDEX if e["kind"] == "dash" and e["file"] not in KNOWN_FAILURES and multi_period(e)],
ids=lambda e: e["file"],
)
def test_corpus_matches_never_cross_codec_or_size(entry: dict[str, Any]):
shape = ("codecs", "width", "height")
for track in parse(entry):
data = track.data["dash"]
want = tuple(DASH.get_attr(a, data["adaptation_set"], data["representation"]) for a in shape)
for period in data["manifest"].findall("Period"):
if period is data["period"] or not DASH.is_content_period(period, []):
continue
found = DASH.resolve_representation(period, data["representation_id"], data["adaptation_set"])
if found is not None:
assert tuple(DASH.get_attr(a, *found) for a in shape) == want