From 46f31b3247d507122eed102bfcc395c18fd0bfa8 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Fri, 6 Mar 2009 15:03:00 +0000 Subject: codec and unicode tests and fixes git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@750934 13f79535-47bb-0310-9956-ffa450edef68 --- python/tests/codec010.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'python/tests/codec010.py') 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): -- cgit v1.2.1