diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-11-21 15:05:39 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-11-21 15:05:39 -0700 |
commit | c02770129db9b27a718dadbf438459c3404c8a5a (patch) | |
tree | 0d3bbcefb02272c2e8dd0fad0cabddaecf19dcca /tests | |
parent | 75bdea29be8ea53c8e005e9020f3f2d1c7dcf689 (diff) | |
download | freeipa-c02770129db9b27a718dadbf438459c3404c8a5a.tar.gz freeipa-c02770129db9b27a718dadbf438459c3404c8a5a.tar.xz freeipa-c02770129db9b27a718dadbf438459c3404c8a5a.zip |
Small changed to test_round_trip() test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_ipalib/test_util.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_ipalib/test_util.py b/tests/test_ipalib/test_util.py index fd7d85f5a..8069d89b8 100644 --- a/tests/test_ipalib/test_util.py +++ b/tests/test_ipalib/test_util.py @@ -30,6 +30,7 @@ from ipalib import util # A string that should have bytes 'x\00' through '\xff': BINARY_BYTES = ''.join(struct.pack('B', d) for d in xrange(256)) assert '\x00' in BINARY_BYTES and '\xff' in BINARY_BYTES +assert type(BINARY_BYTES) is str and len(BINARY_BYTES) == 256 # A UTF-8 encoded str UTF8_BYTES = '\xd0\x9f\xd0\xb0\xd0\xb2\xd0\xb5\xd0\xbb' @@ -41,7 +42,6 @@ assert UNICODE_CHARS.encode('UTF-8') == UTF8_BYTES assert UTF8_BYTES != UNICODE_CHARS - def dump_n_load(value): (param, method) = loads( dumps((value,)) @@ -59,8 +59,8 @@ def test_round_trip(): """ Test `ipalib.util.xmlrpc_wrap` and `ipalib.util.xmlrpc_unwrap`. - This tests the two functions together with ``xmlrpclib.dumps`` and - ``xmlrpclib.loads`` in a full encode/decode round trip. + This tests the two functions together with ``xmlrpclib.dumps()`` and + ``xmlrpclib.loads()`` in a full encode/dumps/loads/decode round trip. """ # We first test that our assumptions about xmlrpclib module in the Python # standard library are correct: @@ -81,6 +81,8 @@ def test_round_trip(): assert round_trip(BINARY_BYTES) == BINARY_BYTES assert type(round_trip('hello')) is str assert type(round_trip(u'hello')) is unicode + assert round_trip('') == '' + assert round_trip(u'') == u'' compound = [UTF8_BYTES, UNICODE_CHARS, BINARY_BYTES, dict(utf8=UTF8_BYTES, chars=UNICODE_CHARS, data=BINARY_BYTES) ] |