From f73d976bdacae37557f0b2ccfa6da01ea58c685d Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Sun, 21 Sep 2008 21:50:56 +0000 Subject: 307: Split Plugin.finalize() into two steps 1) Plugin.set_api() and 2) Plugin.finalize(); updated unit tests --- ipalib/tests/test_plugable.py | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'ipalib/tests/test_plugable.py') diff --git a/ipalib/tests/test_plugable.py b/ipalib/tests/test_plugable.py index 3972cfa9..6c796f9e 100644 --- a/ipalib/tests/test_plugable.py +++ b/ipalib/tests/test_plugable.py @@ -405,26 +405,10 @@ class test_Plugin(ClassChecker): """ Tests the `plugable.Plugin.finalize` method. """ - api = 'the api instance' o = self.cls() - assert read_only(o, 'name') == 'Plugin' - assert repr(o) == '%s.Plugin()' % plugable.__name__ - assert read_only(o, 'api') is None - raises(AssertionError, o.finalize, None) - o.finalize(api) - assert read_only(o, 'api') is api - raises(AssertionError, o.finalize, api) - - class some_plugin(self.cls): - pass - sub = some_plugin() - assert read_only(sub, 'name') == 'some_plugin' - assert repr(sub) == '%s.some_plugin()' % __name__ - assert read_only(sub, 'api') is None - raises(AssertionError, sub.finalize, None) - sub.finalize(api) - assert read_only(sub, 'api') is api - raises(AssertionError, sub.finalize, api) + assert not o.__islocked__() + o.finalize() + assert o.__islocked__() class test_PluginProxy(ClassChecker): -- cgit