diff options
author | Rafael H. Schloming <rhs@apache.org> | 2009-03-06 15:03:00 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2009-03-06 15:03:00 +0000 |
commit | 46f31b3247d507122eed102bfcc395c18fd0bfa8 (patch) | |
tree | d9ccfd43a25b3a8b56e0c9a6c35f77ca7b23bf77 /python/tests/codec010.py | |
parent | 963fc80c1de0c8cbc8caff8608c061f578d39866 (diff) | |
download | qpid-python-46f31b3247d507122eed102bfcc395c18fd0bfa8.tar.gz |
codec and unicode tests and fixes
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@750934 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/tests/codec010.py')
-rw-r--r-- | python/tests/codec010.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/python/tests/codec010.py b/python/tests/codec010.py index 1912eac591..099734a040 100644 --- a/python/tests/codec010.py +++ b/python/tests/codec010.py @@ -23,7 +23,7 @@ from unittest import TestCase from qpid.spec010 import load from qpid.codec010 import StringCodec from qpid.testlib import testrunner -from qpid.datatypes import timestamp +from qpid.datatypes import timestamp, uuid4 class CodecTest(TestCase): @@ -42,6 +42,12 @@ class CodecTest(TestCase): def testMapString(self): self.check("map", {"string": "this is a test"}) + def testMapUnicode(self): + self.check("map", {"unicode": u"this is a unicode test"}) + + def testMapBinary(self): + self.check("map", {"binary": "\x7f\xb4R^\xe5\xf0:\x89\x96E1\xf6\xfe\xb9\x1b\xf5"}) + def testMapInt(self): self.check("map", {"int": 3}) @@ -68,14 +74,20 @@ class CodecTest(TestCase): def testMapList(self): self.check("map", {"list": [1, "two", 3.0, -4]}) + def testMapUUID(self): + self.check("map", {"uuid": uuid4()}) + def testMapAll(self): decoded = self.check("map", {"string": "this is a test", + "unicode": u"this is a unicode test", + "binary": "\x7f\xb4R^\xe5\xf0:\x89\x96E1\xf6\xfe\xb9\x1b\xf5", "int": 3, "long": 2**32, "timestamp": timestamp(0), "none": None, "map": {"string": "nested map"}, - "list": [1, "two", 3.0, -4]}) + "list": [1, "two", 3.0, -4], + "uuid": uuid4()}) assert isinstance(decoded["timestamp"], timestamp) def testMapEmpty(self): |