From 74f5719078adfcfdf8b98bf97f0828dd150c840d Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Fri, 1 Aug 2008 21:25:46 +0000 Subject: 42: plugable.Plugin.__init__() now takes the plugable.API instance as its single argument --- ipalib/tests/test_plugable.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'ipalib/tests/test_plugable.py') diff --git a/ipalib/tests/test_plugable.py b/ipalib/tests/test_plugable.py index fc7fff98..a6f1e7cd 100644 --- a/ipalib/tests/test_plugable.py +++ b/ipalib/tests/test_plugable.py @@ -42,14 +42,17 @@ def test_from_cli(): def test_Plugin(): - p = plugable.Plugin() - assert p.name == 'Plugin' + api = 'the api instance' + p = plugable.Plugin(api) + assert read_only(p, 'api') is api + assert read_only(p, 'name') == 'Plugin' assert repr(p) == '%s.Plugin()' % plugable.__name__ class some_plugin(plugable.Plugin): pass - p = some_plugin() - assert p.name == 'some_plugin' + p = some_plugin(api) + assert read_only(p, 'api') is api + assert read_only(p, 'name') == 'some_plugin' assert repr(p) == '%s.some_plugin()' % __name__ @@ -302,3 +305,7 @@ def test_NameSpace(): raises(KeyError, getitem, ns, cli) raises(AttributeError, getattr, ns, name) no_set(ns, name) + + +def test_API(): + assert issubclass(plugable.API, plugable.ReadOnly) -- cgit