summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib/test_plugable.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-10-30 01:34:46 -0600
committerJason Gerard DeRose <jderose@redhat.com>2008-10-30 01:34:46 -0600
commit2fee6a3e20169f12b837647f0f71d6f28937490f (patch)
treef84fc2ad8486a70ba51be6cd36214ab9dc6ac53f /tests/test_ipalib/test_plugable.py
parentddb5449c7faabbd4c1b71adfe84c386b943a163f (diff)
downloadfreeipa-2fee6a3e20169f12b837647f0f71d6f28937490f.tar.gz
freeipa-2fee6a3e20169f12b837647f0f71d6f28937490f.tar.xz
freeipa-2fee6a3e20169f12b837647f0f71d6f28937490f.zip
Added tests.util.get_api() function to create a standard (api, home) tuple for unit testing
Diffstat (limited to 'tests/test_ipalib/test_plugable.py')
-rw-r--r--tests/test_ipalib/test_plugable.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/test_ipalib/test_plugable.py b/tests/test_ipalib/test_plugable.py
index c7b8abbd9..ce0c79a97 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, TempHome
+from tests.util import ClassChecker, get_api
from ipalib import plugable, errors
@@ -771,13 +771,6 @@ class test_API(ClassChecker):
_cls = plugable.API
- def new(self, *bases):
- home = TempHome()
- api = self.cls(*bases)
- api.env.mode = 'unit_test'
- api.env.in_tree = True
- return (api, home)
-
def test_API(self):
"""
Test the `ipalib.plugable.API` class.
@@ -802,6 +795,8 @@ class test_API(ClassChecker):
return n + 1
api = plugable.API(base0, base1)
+ api.env.mode = 'unit_test'
+ api.env.in_tree = True
r = api.register
assert isinstance(r, plugable.Registrar)
assert read_only(api, 'register') is r
@@ -884,7 +879,7 @@ class test_API(ClassChecker):
"""
Test the `ipalib.plugable.API.bootstrap` method.
"""
- (o, home) = self.new()
+ (o, home) = get_api()
assert o.env._isdone('_bootstrap') is False
assert o.env._isdone('_finalize_core') is False
assert o.isdone('bootstrap') is False
@@ -900,7 +895,7 @@ class test_API(ClassChecker):
"""
Test the `ipalib.plugable.API.load_plugins` method.
"""
- (o, home) = self.new()
+ (o, home) = get_api()
assert o.isdone('bootstrap') is False
assert o.isdone('load_plugins') is False
o.load_plugins()