def test_tvdb_search_series__success_series_id_imdb(tvdb_token): expected_top_level_keys = { "aliases", "banner", "firstAired", "id", "network", "overview", "seriesName", "slug", "status", } result = tvdb_search_series(tvdb_token, id_imdb=LOST_IMDB_ID_SERIES) assert isinstance(result, dict) assert "data" in result data = result["data"] assert len(data) == 1 assert set(data[0].keys()) == expected_top_level_keys
def test_tvdb_search_series__success_series(tvdb_token): expected_top_level_keys = { "aliases", "banner", "firstAired", "id", "network", "overview", "seriesName", "slug", "status", } result = tvdb_search_series(tvdb_token, "Lost") assert isinstance(result, dict) assert "data" in result data = result["data"] assert len(data) == 100 assert expected_top_level_keys == set(data[0].keys())
def test_tvdb_search_series__invalid_id_imdb(tvdb_token): with pytest.raises(MapiProviderException): tvdb_search_series(tvdb_token, "Lost", id_imdb="xyz")
def test_tvdb_search_series__invalid_token(): with pytest.raises(MapiProviderException): tvdb_search_series(JUNK_TEXT, "Lost", cache=False)