示例#1
0
def test_register_a_plugin():
    test_plugin = 'test plugin'

    manager = PluginManager(test_plugin)
    plugin_info = make_me_a_plugin_info('my')
    manager.register_a_plugin(TestClass, plugin_info)
    eq_(plugin_info.cls, TestClass)
    eq_(manager.registry['my'][0], plugin_info)
示例#2
0
def test_get_a_plugin():
    test_plugin = 'test plugin'

    manager = PluginManager(test_plugin)
    plugin_info = make_me_a_plugin_info('my')
    plugin_info.cls = TestClass
    manager.register_a_plugin(TestClass, plugin_info)
    the_plugin = manager.get_a_plugin('my')
    assert isinstance(the_plugin, TestClass)
示例#3
0
def test_register_a_plugin():
    test_plugin = "test plugin"

    manager = PluginManager(test_plugin)
    plugin_info = make_me_a_plugin_info("my")
    manager.register_a_plugin(TestClass, plugin_info)
    eq_(plugin_info.cls, TestClass)
    eq_(manager.registry["my"][0], plugin_info)
    eq_(manager.tag_groups, {"my": "my"})
示例#4
0
def test_register_a_plugin():
    test_plugin = "test plugin"

    manager = PluginManager(test_plugin)
    plugin_info = make_me_a_plugin_info("my")
    manager.register_a_plugin(TestClass, plugin_info)
    assert plugin_info.cls == TestClass
    assert manager.registry["my"][0] == plugin_info
    assert manager.tag_groups == {"my": "my"}
示例#5
0
文件: manager.py 项目: antherkiv/lml
 def register_a_plugin(self, cls):
     PluginManager.register_a_plugin(self, cls)
示例#6
0
 def register_a_plugin(self, cls, plugin_info):
     """ for dynamically loaded plugin """
     PluginManager.register_a_plugin(self, cls, plugin_info)
     _do_additional_registration_for_new_plugins(plugin_info)
示例#7
0
 def register_a_plugin(self, plugin_cls, plugin_info):
     """ for dynamically loaded plugin """
     PluginManager.register_a_plugin(self, plugin_cls, plugin_info)
     self._register_a_plugin_info(plugin_info)
示例#8
0
 def register_a_plugin(self, cls, plugin_info):
     """ for dynamically loaded plugin """
     PluginManager.register_a_plugin(self, cls, plugin_info)
     _do_additional_registration(plugin_info)
 def register_a_plugin(self, plugin_cls, plugin_info):
     """ for dynamically loaded plugin """
     PluginManager.register_a_plugin(self, plugin_cls, plugin_info)
     self._register_a_plugin_info(plugin_info)