diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-22 15:51:54 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-22 15:51:54 -0700 |
commit | c070d390e92df0c9cc6b6070e6c94bd3a130ff65 (patch) | |
tree | 1bee2697b5d4a6a22594128e7774232a374fbdf2 /tests | |
parent | 5b637f6a18a647a0ff084b2932faa1a4a887a5c2 (diff) | |
download | freeipa-c070d390e92df0c9cc6b6070e6c94bd3a130ff65.tar.gz freeipa-c070d390e92df0c9cc6b6070e6c94bd3a130ff65.tar.xz freeipa-c070d390e92df0c9cc6b6070e6c94bd3a130ff65.zip |
Removed Env.__getattr__(); Env no longer accepts callables for values (no more dynamic/lazy values)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_ipalib/test_config.py | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/test_ipalib/test_config.py b/tests/test_ipalib/test_config.py index e17c4799e..6c70aeb95 100644 --- a/tests/test_ipalib/test_config.py +++ b/tests/test_ipalib/test_config.py @@ -374,23 +374,16 @@ class test_Env(ClassChecker): e = raises(StandardError, o.__lock__) assert str(e) == 'Env.__lock__() already called' - def test_getattr(self): + def test_getitem(self): """ - Test the `ipalib.config.Env.__getattr__` method. - - Also tests the `ipalib.config.Env.__getitem__` method. + Test the `ipalib.config.Env.__getitem__` method. """ o = self.cls() value = 'some value' o.key = value assert o.key is value assert o['key'] is value - o.call = lambda: 'whatever' - assert o.call == 'whatever' - assert o['call'] == 'whatever' for name in ('one', 'two'): - e = raises(AttributeError, getattr, o, name) - assert str(e) == 'Env.%s' % name e = raises(KeyError, getitem, o, name) assert str(e) == repr(name) @@ -402,9 +395,9 @@ class test_Env(ClassChecker): """ items = [ ('one', 1), - ('two', lambda: 2), + ('two', 2), ('three', 3), - ('four', lambda: 4), + ('four', 4), ] for setvar in (setattr, setitem): o = self.cls() @@ -457,9 +450,9 @@ class test_Env(ClassChecker): o = self.cls() items = [ ('one', 1), - ('two', lambda: 2), + ('two', 2), ('three', 3), - ('four', lambda: 4), + ('four', 4), ] for (key, value) in items: assert key not in o |