def test_get_matches_no_match(episodes): subtitle = Addic7edSubtitle(Language('eng'), True, None, 'The Big Bang Theory', 7, 5, 'The Workplace Proximity', 2007, 'DIMENSION', None) matches = subtitle.get_matches(episodes['got_s03e10']) assert matches == set()
def test_get_matches_only_year_country(episodes): subtitle = Addic7edSubtitle(Language('eng'), True, None, 'The Big Bang Theory', 7, 5, 'The Workplace Proximity', None, 'DIMENSION', None) matches = subtitle.get_matches(episodes['got_s03e10']) assert matches == {'year', 'country'}
def test_compute_score(episodes): video = episodes['bbt_s07e05'] subtitle = Addic7edSubtitle(Language('eng'), True, None, 'the big BANG theory', 6, 4, None, None, '1080p', None) assert compute_score( subtitle, video) == episode_scores['series'] + episode_scores['year']
def test_get_matches_format_release_group(episodes): subtitle = Addic7edSubtitle(Language('eng'), True, None, 'Game of Thrones', 3, 10, 'Mhysa', None, 'WEB-DL-NTb', None) matches = subtitle.get_matches(episodes['got_s03e10']) assert matches == { 'series', 'season', 'episode', 'title', 'year', 'release_group', 'format' }
def test_get_matches_equivalent_release_group(episodes): subtitle = Addic7edSubtitle(Language('eng'), True, None, 'The Big Bang Theory', 7, 5, 'The Workplace Proximity', 2007, 'LOL', None) matches = subtitle.get_matches(episodes['bbt_s07e05']) assert matches == { 'series', 'season', 'episode', 'title', 'year', 'release_group' }
def test_get_matches_streaming_service(episodes): subtitle = Addic7edSubtitle(Language('nld'), True, None, 'The Walking Dead', 8, 7, None, None, 'AMZN.WEB-DL-CasStudio', None) matches = subtitle.get_matches(episodes['walking_dead_s08e07']) assert matches == { 'series', 'season', 'episode', 'year', 'country', 'release_group', 'streaming_service', 'source' }
def test_get_matches_resolution_release_group(episodes): subtitle = Addic7edSubtitle(Language('heb'), True, None, 'The Big Bang Theory', 7, 5, 'The Workplace Proximity', 2007, '720PDIMENSION', None) matches = subtitle.get_matches(episodes['bbt_s07e05']) assert matches == { 'series', 'season', 'episode', 'title', 'year', 'release_group', 'resolution' }
def test_download_subtitles(mock_providers): subtitles = [ Addic7edSubtitle(Language('eng'), True, None, 'The Big Bang Theory', 7, 5, 'The Workplace Proximity', 2007, 'DIMENSION', None), TheSubDBSubtitle(Language('eng'), 'ad32876133355929d814457537e12dc2'), TVsubtitlesSubtitle(Language('por'), None, 261077, 'Game of Thrones', 3, 10, None, '1080p.BluRay', 'DEMAND') ] download_subtitles(subtitles) # test providers assert provider_manager['addic7ed'].plugin.download_subtitle.called assert not provider_manager['opensubtitles'].plugin.download_subtitle.called assert not provider_manager['podnapisi'].plugin.download_subtitle.called assert provider_manager['thesubdb'].plugin.download_subtitle.called assert provider_manager['tvsubtitles'].plugin.download_subtitle.called assert not provider_manager['subscenter'].plugin.download_subtitle.called