def test_create_search_string_anime(p, create_tvshow, create_tvepisode, monkeypatch_function_return): series_name = p['series_name'] separator = p['separator'] series_alias = p['series_alias'] add_string = p['add_string'] expected = p['expected'] monkeypatch_function_return([( 'medusa.scene_exceptions.get_season_scene_exceptions', p['season_scene_name_exceptions'] )]) mock_series = create_tvshow(indexer=1, name=series_name) provider = GenericProvider('mock_provider') provider.series = mock_series provider.search_separator = separator episode = create_tvepisode(mock_series, 1, 12) episode.scene_episode = p['scene_episode'] episode.scene_absolute_number = p['scene_episode_absolute'] episode.scene_season = p['scene_season'] search_string = { 'Episode': [] } # Create search strings for alias in [series_name] + series_alias: provider._create_anime_search_string(alias, episode, search_string, add_string=add_string) actual = search_string['Episode'] assert expected == actual
def test_create_search_string_anime(p, create_tvshow, create_tvepisode, monkeypatch_function_return): series_name = p['series_name'] separator = p['separator'] series_alias = p['series_alias'] add_string = p['add_string'] expected = p['expected'] monkeypatch_function_return([( 'medusa.scene_exceptions.get_season_scene_exceptions', p['season_scene_name_exceptions'] )]) mock_series = create_tvshow(indexer=1, name=series_name) mock_series.scene = p['series_scene'] provider = GenericProvider('mock_provider') provider.series = mock_series provider.search_separator = separator episode = create_tvepisode(mock_series, 1, 12) episode.scene_episode = p['scene_episode'] episode.scene_season = p['scene_season'] episode.absolute_number = p['absolute_number'] episode.scene_absolute_number = p['scene_absolute_number'] search_string = { 'Episode': [] } # Create search strings for alias in [series_name] + series_alias: provider._create_anime_search_string(alias, episode, search_string, add_string=add_string) actual = search_string['Episode'] assert expected == actual
def test_create_search_string_sports(p, create_tvshow, create_tvepisode): series_name = p['series_name'] separator = p['separator'] series_alias = p['series_alias'] add_string = p['add_string'] expected = p['expected'] mock_series = create_tvshow(indexer=1, name=series_name) provider = GenericProvider('mock_provider') provider.series = mock_series provider.search_separator = separator episode = create_tvepisode(mock_series, 1, 12) episode.airdate = date(2018, 1, 10) search_string = { 'Episode': [] } # Create search strings for alias in [series_name] + series_alias: provider._create_sports_search_string(alias, episode, search_string, add_string=add_string) actual = search_string['Episode'] assert expected == actual
def test_create_search_string_sports(p, create_tvshow, create_tvepisode): series_name = p['series_name'] separator = p['separator'] series_alias = p['series_alias'] add_string = p['add_string'] expected = p['expected'] mock_series = create_tvshow(indexer=1, name=series_name) provider = GenericProvider('mock_provider') provider.series = mock_series provider.search_separator = separator episode = create_tvepisode(mock_series, 1, 12) episode.airdate = date(2018, 1, 10) search_string = { 'Episode': [] } # Create search strings for alias in [series_name] + series_alias: provider._create_sports_search_string(alias, episode, search_string, add_string=add_string) actual = search_string['Episode'] assert expected == actual