summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-11-13 22:16:04 -0700
committerJason Gerard DeRose <jderose@redhat.com>2008-11-13 22:16:04 -0700
commit860d391f3e905e20ba3f409c92d98e68450f3137 (patch)
tree660d9752e8889a22a01284322e9a8d90bdea7448 /tests
parent1f635269e8c0253230c3d20b6b41ccd91e02f361 (diff)
downloadfreeipa-860d391f3e905e20ba3f409c92d98e68450f3137.tar.gz
freeipa-860d391f3e905e20ba3f409c92d98e68450f3137.tar.xz
freeipa-860d391f3e905e20ba3f409c92d98e68450f3137.zip
Change Param.__repr__() so it returns the exact expression that could create it; added unit test for Param.__repre__()
Diffstat (limited to 'tests')
-rw-r--r--tests/test_ipalib/test_frontend.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_ipalib/test_frontend.py b/tests/test_ipalib/test_frontend.py
index 75e098a42..2a8c08fe7 100644
--- a/tests/test_ipalib/test_frontend.py
+++ b/tests/test_ipalib/test_frontend.py
@@ -430,6 +430,18 @@ class test_Param(ClassChecker):
o = self.cls(name, type=ipa_types.Enum(*values))
assert o.get_values() == values
+ def test_repr(self):
+ """
+ Test the `ipalib.frontend.Param.__repr__` method.
+ """
+ for name in ['name', 'name?', 'name*', 'name+']:
+ o = self.cls(name)
+ assert repr(o) == 'Param(%r)' % name
+ o = self.cls('name', required=False)
+ assert repr(o) == "Param('name', required=False)"
+ o = self.cls('name', multivalue=True)
+ assert repr(o) == "Param('name', multivalue=True)"
+
def test_create_param():
"""