From bb9691099b7b025fc491279314d8803f4fa3b571 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Mon, 27 Oct 2008 15:36:41 -0600 Subject: API.bootstrap() now calls Env._finalize_core(); updated unit tests --- tests/test_ipalib/test_plugable.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests/test_ipalib/test_plugable.py') diff --git a/tests/test_ipalib/test_plugable.py b/tests/test_ipalib/test_plugable.py index ba98e752..50cab930 100644 --- a/tests/test_ipalib/test_plugable.py +++ b/tests/test_ipalib/test_plugable.py @@ -23,7 +23,7 @@ Test the `ipalib.plugable` module. from tests.util import raises, no_set, no_del, read_only from tests.util import getitem, setitem, delitem -from tests.util import ClassChecker +from tests.util import ClassChecker, TempHome from ipalib import plugable, errors @@ -771,6 +771,12 @@ class test_API(ClassChecker): _cls = plugable.API + def new(self, *bases): + home = TempHome() + api = self.cls(*bases) + api.env.in_tree = True + return (api, home) + def test_API(self): """ Test the `ipalib.plugable.API` class. @@ -877,10 +883,14 @@ class test_API(ClassChecker): """ Test the `ipalib.plugable.API.bootstrap` method. """ - o = self.cls() + (o, home) = self.new() + assert o.env._isdone('_bootstrap') is False + assert o.env._isdone('_finalize_core') is False assert o.isdone('bootstrap') is False o.bootstrap() assert o.isdone('bootstrap') is True + assert o.env._isdone('_bootstrap') is True + assert o.env._isdone('_finalize_core') is True e = raises(StandardError, o.bootstrap) assert str(e) == 'API.bootstrap() already called' -- cgit