forked from kenzuya/unshackle
feat(providers): fill the western IDs of an AniList match from the anime-lists ID map
This commit is contained in:
@@ -239,6 +239,19 @@ def test_a_listing_prints_the_search_match(monkeypatch: pytest.MonkeyPatch) -> N
|
||||
assert "Search -> The Show (ID 1396)" in captured.get()
|
||||
|
||||
|
||||
def test_an_anilist_search_hit_keeps_its_anilist_id_for_the_tags(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
hit = MetadataResult(
|
||||
title="The Show", external_ids=ExternalIds(tmdb_id=37854, tmdb_kind="tv", anilist_id=21), source="anilist"
|
||||
)
|
||||
Providers(monkeypatch, hit)
|
||||
monkeypatch.setattr(providers, "result_matches", lambda result, title: result.title == title)
|
||||
metadata = TitleMetadata()
|
||||
with console.capture() as captured:
|
||||
metadata.search(episode(1, 1), listing=True)
|
||||
assert (metadata.tmdb_id, metadata.anilist_id) == (37854, 21)
|
||||
assert "Search -> The Show (ID 37854)" in captured.get()
|
||||
|
||||
|
||||
def test_a_listing_with_no_movie_match_says_so(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
Providers(monkeypatch, None)
|
||||
with console.capture() as captured:
|
||||
|
||||
Reference in New Issue
Block a user