Esempio n. 1
0
def make_plugins(available=None, enabled=None):
    plugins = PluginManager()
    if available:
        for plugin in available:
            plugins.register(plugin)
    if enabled is not None:
        for plugin in enabled:
            plugins.enable(plugin)
    return plugins
Esempio n. 2
0
    def test_register(self):
        plugins = PluginManager()
        self.assertEqual(plugins.available, [])

        plugins.register(Foo)
        self.assertEqual(plugins.available, [Foo])