forked from kenzuya/unshackle
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -29,10 +29,6 @@ def test_two_ids_are_refused(tmdb: int | None, imdb: str | None, tvdb: int | Non
|
||||
assert "cannot be used together" in str(exc.value)
|
||||
|
||||
|
||||
def test_no_ids_is_fine() -> None:
|
||||
assert validate_metadata_ids(None, None, None) is None
|
||||
|
||||
|
||||
def test_imdb_alone_passes_on_the_keyless_provider(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
with_keys(monkeypatch)
|
||||
assert validate_metadata_ids(None, "tt1375666", None) is None
|
||||
@@ -45,13 +41,6 @@ def test_tmdb_without_its_key_names_the_key(monkeypatch: pytest.MonkeyPatch) ->
|
||||
assert "--tmdb" in str(exc.value) and "tmdb_api_key" in str(exc.value)
|
||||
|
||||
|
||||
def test_tvdb_without_its_key_names_the_key(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
with_keys(monkeypatch)
|
||||
with pytest.raises(PlanError) as exc:
|
||||
validate_metadata_ids(None, None, 73871)
|
||||
assert "--tvdb" in str(exc.value) and "tvdb_api_key" in str(exc.value)
|
||||
|
||||
|
||||
def test_tmdb_with_its_key_passes(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
with_keys(monkeypatch, tmdb_api_key="k")
|
||||
assert validate_metadata_ids(27205, None, None) is None
|
||||
@@ -105,12 +94,6 @@ def test_api_still_reports_a_malformed_id_first() -> None:
|
||||
assert err and "positive integer" in err
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value", [21, "21", "mal:21"])
|
||||
def test_anilist_alone_passes_without_any_key(monkeypatch: pytest.MonkeyPatch, value: object) -> None:
|
||||
with_keys(monkeypatch)
|
||||
assert validate_metadata_ids(None, None, None, value) is None
|
||||
|
||||
|
||||
def test_anilist_pairs_with_one_other_id(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
with_keys(monkeypatch)
|
||||
assert validate_metadata_ids(None, "tt1375666", None, 21) is None
|
||||
@@ -151,14 +134,6 @@ def test_api_refuses_a_malformed_anilist_id(value: object) -> None:
|
||||
assert err and "anilist" in err
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value", ["0", "mal:0", "²", "21.5"])
|
||||
def test_a_non_positive_or_non_decimal_anilist_value_is_refused(monkeypatch: pytest.MonkeyPatch, value: str) -> None:
|
||||
with_keys(monkeypatch)
|
||||
with pytest.raises(PlanError) as exc:
|
||||
validate_metadata_ids(None, None, None, value)
|
||||
assert "--anilist" in str(exc.value)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("payload", [{"anilist_id": "MAL:21"}, {"anilist_id": "007"}, {"anilist_id": " 21 "}])
|
||||
def test_api_accepts_what_the_cli_accepts(payload: dict) -> None:
|
||||
"""Both surfaces share parse_anilist_ref, so their accept sets cannot drift."""
|
||||
|
||||
Reference in New Issue
Block a user