diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2010-09-09 18:49:35 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2010-09-09 18:49:35 +0000 |
| commit | b2645a3feaafd3ecb08669024debee3fdde922ff (patch) | |
| tree | 64ef6acf04c871bc01b1b8c06b1751738817441c /qpid/python | |
| parent | 052c26efb0c66241984d8a5c3dd912938a12d012 (diff) | |
| download | qpid-python-b2645a3feaafd3ecb08669024debee3fdde922ff.tar.gz | |
fixed bool encoding
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@995537 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
| -rw-r--r-- | qpid/python/qpid/codec010.py | 1 | ||||
| -rw-r--r-- | qpid/python/qpid/tests/messaging/message.py | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/qpid/python/qpid/codec010.py b/qpid/python/qpid/codec010.py index 682743df19..d65f8c36f5 100644 --- a/qpid/python/qpid/codec010.py +++ b/qpid/python/qpid/codec010.py @@ -36,6 +36,7 @@ def map_str(s): class Codec(Packer): ENCODINGS = { + bool: direct("boolean"), unicode: direct("str16"), str: map_str, buffer: direct("vbin32"), diff --git a/qpid/python/qpid/tests/messaging/message.py b/qpid/python/qpid/tests/messaging/message.py index eaa953e7d7..297374b82b 100644 --- a/qpid/python/qpid/tests/messaging/message.py +++ b/qpid/python/qpid/tests/messaging/message.py @@ -86,6 +86,8 @@ class MessageEchoTests(Base): "key7": ["one", 2, 3.14], "key8": [], "key9": {"sub-key0": 3}, + "key10": True, + "key11": False, "x-amqp-0-10.app-id": "test-app-id", "x-amqp-0-10.content-encoding": "test-content-encoding"} @@ -141,3 +143,13 @@ class MessageEchoTests(Base): def testReplyToTopicSubject(self): self.check_rt("name/subject; {node: {type: topic}}") + + def testBooleanEncoding(self): + msg = Message({"true": True, "false": False}) + self.snd.send(msg) + echo = self.rcv.fetch(0) + self.assertEcho(msg, echo) + t = echo.content["true"] + f = echo.content["false"] + assert isinstance(t, bool), t + assert isinstance(f, bool), f |
