diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-11-13 21:07:47 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-11-13 21:07:47 -0700 |
commit | 8ad5502354a364db606b72455c5514cb56e918ba (patch) | |
tree | 6bd9e8481c0268fea7095b3ffab354bb93f51f4d /tests | |
parent | 01a7f1f437b72c2c13c6abfb02c6dea3924fa291 (diff) | |
download | freeipa-8ad5502354a364db606b72455c5514cb56e918ba.tar.gz freeipa-8ad5502354a364db606b72455c5514cb56e918ba.tar.xz freeipa-8ad5502354a364db606b72455c5514cb56e918ba.zip |
Added util.make_repr() function; added corresponding unit tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_ipalib/test_util.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/test_ipalib/test_util.py b/tests/test_ipalib/test_util.py index 04ff23f09..6729fcda5 100644 --- a/tests/test_ipalib/test_util.py +++ b/tests/test_ipalib/test_util.py @@ -27,7 +27,7 @@ from ipalib import util def test_xmlrpc_marshal(): """ - Test the `util.xmlrpc_marshal` function. + Test the `ipalib.util.xmlrpc_marshal` function. """ f = util.xmlrpc_marshal assert f() == ({},) @@ -39,7 +39,7 @@ def test_xmlrpc_marshal(): def test_xmlrpc_unmarshal(): """ - Test the `util.xmlrpc_unmarshal` function. + Test the `ipalib.util.xmlrpc_unmarshal` function. """ f = util.xmlrpc_unmarshal assert f() == (tuple(), {}) @@ -47,3 +47,15 @@ def test_xmlrpc_unmarshal(): assert f(dict(one=1, two=2)) == (tuple(), dict(one=1, two=2)) assert f(dict(three=3, four=4), 'one', 'two') == \ (('one', 'two'), dict(three=3, four=4)) + + +def test_make_repr(): + """ + Test the `ipalib.util.make_repr` function. + """ + f = util.make_repr + assert f('my') == 'my()' + assert f('my', True, u'hello') == "my(True, u'hello')" + assert f('my', one=1, two='two') == "my(one=1, two='two')" + assert f('my', None, 3, dog='animal', apple='fruit') == \ + "my(None, 3, apple='fruit', dog='animal')" |