summaryrefslogtreecommitdiffstats
path: root/ipalib/tests/tstutil.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-08-01 20:42:35 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-08-01 20:42:35 +0000
commitf3762a76c0824296e90385eac27455aaf06af32d (patch)
treea4683b6b4b19a49882cc810799c7cb6f8515b0af /ipalib/tests/tstutil.py
parent4fe8e52ecb61088bcff2a7c91db454621d6755f1 (diff)
downloadfreeipa.git-f3762a76c0824296e90385eac27455aaf06af32d.tar.gz
freeipa.git-f3762a76c0824296e90385eac27455aaf06af32d.tar.xz
freeipa.git-f3762a76c0824296e90385eac27455aaf06af32d.zip
40: Rewrote dictionary interface for plugable.NameSpace to better suite new architecture
Diffstat (limited to 'ipalib/tests/tstutil.py')
-rw-r--r--ipalib/tests/tstutil.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipalib/tests/tstutil.py b/ipalib/tests/tstutil.py
index 37b7745f..12ca119d 100644
--- a/ipalib/tests/tstutil.py
+++ b/ipalib/tests/tstutil.py
@@ -49,6 +49,14 @@ def raises(exception, callback, *args, **kw):
raise ExceptionNotRaised(exception)
+def getitem(obj, key):
+ """
+ Works like getattr but for dictionary interface. Uses this in combination
+ with raises() to test that, for example, KeyError is raised.
+ """
+ return obj[key]
+
+
def no_set(obj, name, value='some_new_obj'):
"""
Tests that attribute cannot be set.