예제 #1
0
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
예제 #2
0
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
    for name in ('addic7ed', 'legendastv', 'napiprojekt', 'opensubtitles',
                 'opensubtitlesvip', 'podnapisi', 'shooter'):
        assert not provider_manager[name].plugin.download_subtitle.called

    for name in ('thesubdb', 'tvsubtitles'):
        assert provider_manager[name].plugin.download_subtitle.called
예제 #3
0
def test_get_matches_no_match(episodes):
    subtitle = TheSubDBSubtitle(Language('eng'),
                                'ad32876133355929d814457537e12dc2')
    matches = subtitle.get_matches(episodes['got_s03e10'])
    assert matches == set()
예제 #4
0
def test_get_matches(movies):
    subtitle = TheSubDBSubtitle(Language('eng'),
                                'ad32876133355929d814457537e12dc2')
    matches = subtitle.get_matches(movies['man_of_steel'])
    assert matches == {'hash'}