summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-12-22 23:09:35 -0700
committerJason Gerard DeRose <jderose@redhat.com>2008-12-22 23:09:35 -0700
commitfd43b39145382b96cd2e0d0da3d5dcbe0d3a4a2a (patch)
tree746f5a65638d3dfc7a72363532380e4a6b31cc6f /tests/test_ipalib
parent01cae56e0a19876cf6a614469c0c5e6fb73170e6 (diff)
downloadfreeipa-fd43b39145382b96cd2e0d0da3d5dcbe0d3a4a2a.tar.gz
freeipa-fd43b39145382b96cd2e0d0da3d5dcbe0d3a4a2a.tar.xz
freeipa-fd43b39145382b96cd2e0d0da3d5dcbe0d3a4a2a.zip
Moved setting of run-time variables from Env.__init__() to Env._bootstrap()
Diffstat (limited to 'tests/test_ipalib')
-rw-r--r--tests/test_ipalib/test_config.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/test_ipalib/test_config.py b/tests/test_ipalib/test_config.py
index 740ef6cf6..8884697e0 100644
--- a/tests/test_ipalib/test_config.py
+++ b/tests/test_ipalib/test_config.py
@@ -147,13 +147,9 @@ class test_Env(ClassChecker):
Test the `ipalib.config.Env.__init__` method.
"""
(o, home) = self.new()
- ipalib = path.dirname(path.abspath(config.__file__))
- assert o.ipalib == ipalib
- assert o.site_packages == path.dirname(ipalib)
- assert o.script == path.abspath(sys.argv[0])
- assert o.bin == path.dirname(path.abspath(sys.argv[0]))
- assert o.home == home.path
- assert o.dot_ipa == home.join('.ipa')
+ assert list(o) == []
+ assert len(o) == 0
+ assert o.__islocked__() is False
def test_setattr(self):
"""
@@ -246,10 +242,14 @@ class test_Env(ClassChecker):
"""
# Test defaults created by _bootstrap():
(o, home) = self.new()
- assert 'in_tree' not in o
- assert 'context' not in o
- assert 'conf' not in o
o._bootstrap()
+ ipalib = path.dirname(path.abspath(config.__file__))
+ assert o.ipalib == ipalib
+ assert o.site_packages == path.dirname(ipalib)
+ assert o.script == path.abspath(sys.argv[0])
+ assert o.bin == path.dirname(path.abspath(sys.argv[0]))
+ assert o.home == home.path
+ assert o.dot_ipa == home.join('.ipa')
assert o.in_tree is False
assert o.context == 'default'
assert o.conf == '/etc/ipa/default.conf'
@@ -422,6 +422,7 @@ class test_Env(ClassChecker):
no_exist = tmp.join('no_exist.conf')
assert not path.exists(no_exist)
o = self.cls()
+ o._bootstrap()
keys = tuple(o)
orig = dict((k, o[k]) for k in o)
assert o._merge_config(no_exist) is None