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
@@ -3,7 +3,6 @@
from __future__ import annotations
import pytest
from langcodes import Language
from unshackle.core.utilities import matched_language_tags, partition_exclusions
from unshackle.core.utils.click_types import LANGUAGE_RANGE
@@ -28,15 +27,6 @@ def test_partition_keeps_the_written_order_and_drops_repeats():
assert partition_exclusions(["ja", "en", "ja", "-es", "-es"]) == (["ja", "en"], ["es"])
@pytest.mark.parametrize("token", ["-", " - ", "", " "])
def test_partition_skips_tokens_with_no_value(token):
assert partition_exclusions(["en", token]) == (["en"], [])
def test_partition_trims_whitespace_around_a_token():
assert partition_exclusions([" en ", "- es "]) == (["en"], ["es"])
def test_partition_reads_the_tokens_language_range_produces():
assert partition_exclusions(LANGUAGE_RANGE.convert("all,-es;-fr")) == (["all"], ["es", "fr"])
@@ -59,21 +49,5 @@ def test_exact_match_falls_back_to_the_paradigm_variant():
assert matched_language_tags(["es"], ["es-ES", "es-419"], exact=True) == {"es-ES"}
def test_exact_match_keeps_an_unnamed_regional_variant():
assert matched_language_tags(["es-ES"], ["es-ES", "es-419"], exact=True) == {"es-ES"}
def test_language_objects_are_accepted():
assert matched_language_tags(["es"], [Language.get("es")]) == {"es"}
def test_an_untagged_track_is_never_excluded():
assert matched_language_tags(["es"], [None, "en-US"]) == set()
def test_no_exclusions_excludes_nothing():
assert matched_language_tags([], ["es-419", "en-US"]) == set()
def test_an_unmatched_language_is_kept():
assert matched_language_tags(["es", "fr"], ["en-US", "ja-JP"]) == set()