forked from kenzuya/unshackle
test: delete slow, timing-based and redundant tests
This commit is contained in:
+1
-27
@@ -7,7 +7,7 @@ import pytest
|
||||
from unshackle.core import providers
|
||||
from unshackle.core.config import config
|
||||
from unshackle.core.providers import result_matches
|
||||
from unshackle.core.providers.tvdb import TVDBProvider, ids_from_remote, pick_match, result_names
|
||||
from unshackle.core.providers.tvdb import TVDBProvider, ids_from_remote, pick_match
|
||||
from unshackle.core.utils.tags import build_tags_from_ids
|
||||
|
||||
REMOTE_IDS = [
|
||||
@@ -62,10 +62,6 @@ def test_order_map_reverses_with_source_order(monkeypatch: pytest.MonkeyPatch) -
|
||||
assert mapping[(1, 10)] == (2, 1, "A Flight to Remember")
|
||||
|
||||
|
||||
def test_order_map_is_noop_when_orders_match() -> None:
|
||||
assert TVDBProvider().get_order_map(73871, "official") == {}
|
||||
|
||||
|
||||
def test_order_map_empty_when_order_missing(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
p = TVDBProvider()
|
||||
stub(p, monkeypatch)
|
||||
@@ -119,11 +115,6 @@ EXAMPLE_HIT = {
|
||||
}
|
||||
|
||||
|
||||
def test_result_names_lists_each_name_once() -> None:
|
||||
assert result_names(EXAMPLE_HIT) == ("エグザンプル", "Eguzanpuru", "EXAMPLE Show")
|
||||
assert result_names({"name": "EXAMPLE", "aliases": [{"language": "eng", "name": "x"}, ""]}) == ("EXAMPLE",)
|
||||
|
||||
|
||||
def test_search_matches_on_a_translated_name(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
p = TVDBProvider()
|
||||
monkeypatch.setattr(p, "api_get", lambda path, params=None: [EXAMPLE_HIT])
|
||||
@@ -133,11 +124,6 @@ def test_search_matches_on_a_translated_name(monkeypatch: pytest.MonkeyPatch) ->
|
||||
assert not result_matches(result, "OTHER Show")
|
||||
|
||||
|
||||
def test_cached_tvdb_result_matches_on_a_translated_name() -> None:
|
||||
result = providers.cached_to_result(EXAMPLE_HIT, "tvdb", "tv")
|
||||
assert result is not None and result_matches(result, "EXAMPLE Show")
|
||||
|
||||
|
||||
def test_tvdb2_tag_follows_the_matroska_spec() -> None:
|
||||
# TVDB2 IDs are prefixed by entity type: matroska.org/technical/tagging.html
|
||||
from unshackle.core.providers import ExternalIds
|
||||
@@ -146,11 +132,6 @@ def test_tvdb2_tag_follows_the_matroska_spec() -> None:
|
||||
assert build_tags_from_ids(ExternalIds(tvdb_id=113), "movie")["TVDB2"] == "movies/113"
|
||||
|
||||
|
||||
def test_provider_order_defaults(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(config, "metadata_providers", [])
|
||||
assert [c.NAME for c in providers.provider_order()] == list(providers.DEFAULT_ORDER)
|
||||
|
||||
|
||||
def test_provider_order_is_configurable(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(config, "metadata_providers", ["TVDB", "tmdb", "nope", "tvdb"])
|
||||
# unknown entries dropped, duplicates collapsed, case ignored, order kept
|
||||
@@ -216,13 +197,6 @@ def test_get_episodes_fails_closed_on_a_truncated_listing(monkeypatch: pytest.Mo
|
||||
assert p._episodes == {}
|
||||
|
||||
|
||||
def test_get_episodes_does_not_cache_an_empty_listing(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
p = TVDBProvider()
|
||||
monkeypatch.setattr(p, "api_get", lambda _path, params: None)
|
||||
assert p.get_episodes(73871, "official") == []
|
||||
assert p._episodes == {}
|
||||
|
||||
|
||||
class _Svc:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user