summaryrefslogtreecommitdiffstats
path: root/ipalib/tests/test_plugable.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/tests/test_plugable.py')
-rw-r--r--ipalib/tests/test_plugable.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/ipalib/tests/test_plugable.py b/ipalib/tests/test_plugable.py
index 6c796f9e..02d35cde 100644
--- a/ipalib/tests/test_plugable.py
+++ b/ipalib/tests/test_plugable.py
@@ -795,3 +795,22 @@ def test_API():
# Test that calling finilize again raises AssertionError:
raises(AssertionError, api.finalize)
+
+ # Test with base class that doesn't request a proxy
+ class NoProxy(plugable.Plugin):
+ __proxy__ = False
+ api = plugable.API(NoProxy)
+ class plugin0(NoProxy):
+ pass
+ api.register(plugin0)
+ class plugin1(NoProxy):
+ pass
+ api.register(plugin1)
+ api.finalize()
+ names = ['plugin0', 'plugin1']
+ assert list(api.NoProxy) == names
+ for name in names:
+ plugin = api.NoProxy[name]
+ assert getattr(api.NoProxy, name) is plugin
+ assert isinstance(plugin, plugable.Plugin)
+ assert not isinstance(plugin, plugable.PluginProxy)