Exemple #1
0
def test_registrable_extension_manager_register():
    manager = RegistrableExtensionManager('subliminal.test_providers', [
        'addic7ed = subliminal.providers.addic7ed:Addic7edProvider',
        'opensubtitles = subliminal.providers.opensubtitles:OpenSubtitlesProvider'
    ])
    assert len(list(manager)) == 2
    manager.register('de7cidda = subliminal.providers.addic7ed:Addic7edProvider')
    assert len(list(manager)) == 3
    assert 'de7cidda' in manager.names()
Exemple #2
0
def test_registrable_extension_manager_register():
    manager = RegistrableExtensionManager('subliminal.test_providers', [
        'addic7ed = subliminal.providers.addic7ed:Addic7edProvider',
        'opensubtitles = subliminal.providers.opensubtitles:OpenSubtitlesProvider'
    ])
    assert len(list(manager)) == 2
    manager.register(
        'de7cidda = subliminal.providers.addic7ed:Addic7edProvider')
    assert len(list(manager)) == 3
    assert 'de7cidda' in manager.names()
Exemple #3
0
def test_registrable_extension_manager_unregister():
    manager = RegistrableExtensionManager('subliminal.test_providers', [
        'subscenter = subliminal.providers.subscenter:SubsCenterProvider',
        'thesubdb = subliminal.providers.thesubdb:TheSubDBProvider',
        'tvsubtitles = subliminal.providers.tvsubtitles:TVsubtitlesProvider'
    ])
    assert len(list(manager)) == 3
    manager.register('de7cidda = subliminal.providers.addic7ed:Addic7edProvider')
    manager.unregister('de7cidda = subliminal.providers.addic7ed:Addic7edProvider')
    assert len(list(manager)) == 3
    assert set(manager.names()) == {'subscenter', 'thesubdb', 'tvsubtitles'}
Exemple #4
0
def test_registrable_extension_manager_unregister():
    manager = RegistrableExtensionManager('subliminal.test_providers', [
        'thesubdb = subliminal.providers.thesubdb:TheSubDBProvider',
        'tvsubtitles = subliminal.providers.tvsubtitles:TVsubtitlesProvider'
    ])
    assert len(list(manager)) == 2
    manager.register(
        'de7cidda = subliminal.providers.addic7ed:Addic7edProvider')
    manager.unregister(
        'de7cidda = subliminal.providers.addic7ed:Addic7edProvider')
    assert len(list(manager)) == 2
    assert set(manager.names()) == {'thesubdb', 'tvsubtitles'}