Beispiel #1
0
def test_load_me_now_exception(mock_import):
    custom_class = PluginInfo
    mock_import.return_value = custom_class
    test_plugin = 'my plugin'
    manager = PluginManager(test_plugin)
    plugin_info = make_me_a_plugin_info('my')
    manager.load_me_later(plugin_info)
    manager.load_me_now('my', 'my special library')
Beispiel #2
0
def test_load_me_now(mock_import):
    custom_class = PluginInfo
    mock_import.return_value = custom_class
    test_plugin = 'my plugin'
    manager = PluginManager(test_plugin)
    plugin_info = make_me_a_plugin_info(test_plugin)
    manager.load_me_later(plugin_info)
    actual = manager.load_me_now(test_plugin)
    eq_(actual, custom_class)
Beispiel #3
0
def test_load_me_now_exception(mock_import):
    custom_class = PluginInfo
    mock_import.return_value = custom_class
    test_plugin = "my plugin"
    with raises(Exception):
        manager = PluginManager(test_plugin)
        plugin_info = make_me_a_plugin_info("my")
        manager.load_me_later(plugin_info)
        manager.load_me_now("my", "my special library")
Beispiel #4
0
def test_load_me_now_with_known_missing_library(mock_import):
    custom_class = PluginInfo
    mock_import.return_value = custom_class
    test_plugin = "my plugin"
    manager = PluginManager(test_plugin)
    plugin_info = make_me_a_plugin_info(test_plugin)
    manager.load_me_later(plugin_info)
    with raises(Exception):
        manager.load_me_now(test_plugin, library='alien')
Beispiel #5
0
def test_load_me_now(mock_import):
    custom_class = PluginInfo
    mock_import.return_value = custom_class
    test_plugin = "my plugin"
    manager = PluginManager(test_plugin)
    plugin_info = make_me_a_plugin_info(test_plugin)
    manager.load_me_later(plugin_info)
    actual = manager.load_me_now(test_plugin)
    eq_(actual, custom_class)
    eq_(manager.tag_groups, {"my plugin": "my plugin"})
    eq_(plugin_info, manager.registry["my plugin"][0])
Beispiel #6
0
def test_load_me_now(mock_import):
    custom_class = PluginInfo
    mock_import.return_value = custom_class
    test_plugin = "my plugin"
    manager = PluginManager(test_plugin)
    plugin_info = make_me_a_plugin_info(test_plugin)
    manager.load_me_later(plugin_info)
    actual = manager.load_me_now(test_plugin)
    assert actual == custom_class
    assert manager.tag_groups == {"my plugin": "my plugin"}
    assert plugin_info == manager.registry["my plugin"][0]
Beispiel #7
0
 def load_me_later(self, plugin_info):
     PluginManager.load_me_later(self, plugin_info)
Beispiel #8
0
 def load_me_later(self, plugin_info):
     PluginManager.load_me_later(self, plugin_info)
     _do_additional_registration_for_new_plugins(plugin_info)
Beispiel #9
0
 def load_me_later(self, plugin_info):
     PluginManager.load_me_later(self, plugin_info)
     self._register_a_plugin_info(plugin_info)
Beispiel #10
0
def test_load_me_later():
    test_plugin = 'my plugin'
    manager = PluginManager(test_plugin)
    plugin_info = make_me_a_plugin_info(test_plugin)
    manager.load_me_later(plugin_info)
    assert list(manager.registry.keys()) == [test_plugin]
Beispiel #11
0
 def load_me_later(self, plugin_info):
     PluginManager.load_me_later(self, plugin_info)
     _do_additional_registration(plugin_info)
 def load_me_later(self, plugin_info):
     PluginManager.load_me_later(self, plugin_info)
     self._register_a_plugin_info(plugin_info)