diff options
author | Rafael H. Schloming <rhs@apache.org> | 2009-06-03 17:24:25 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2009-06-03 17:24:25 +0000 |
commit | 39eb9755d71d77df1e67e5a51e5bf3d1e4e8da04 (patch) | |
tree | f23375664a4a4bf928fb43f222741a95bb38eeb7 /python/qpid/tests/messaging.py | |
parent | 298f6aa34e0cd07e0d89016990bd9c21902c811d (diff) | |
download | qpid-python-39eb9755d71d77df1e67e5a51e5bf3d1e4e8da04.tar.gz |
added tests for sender
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@781485 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/tests/messaging.py')
-rw-r--r-- | python/qpid/tests/messaging.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/python/qpid/tests/messaging.py b/python/qpid/tests/messaging.py index e32b91a26b..ed02d7a27a 100644 --- a/python/qpid/tests/messaging.py +++ b/python/qpid/tests/messaging.py @@ -385,6 +385,41 @@ class ReceiverTests(Base): # XXX: need testClose +class SenderTests(Base): + + def setup_connection(self): + return Connection.open(self.broker.host, self.broker.port) + + def setup_session(self): + return self.conn.session() + + def setup_sender(self): + return self.ssn.sender("test-sender-queue") + + def setup_receiver(self): + return self.ssn.receiver("test-sender-queue") + + def checkContent(self, content): + self.snd.send(content) + msg = self.rcv.fetch(0) + assert msg.content == content + + out = Message(content) + self.snd.send(out) + echo = self.rcv.fetch(0) + assert out.content == echo.content + assert echo.content == msg.content + self.ssn.acknowledge() + + def testSendString(self): + self.checkContent("testSendString[%s]" % uuid4()) + + def testSendList(self): + self.checkContent(["testSendList", 1, 3.14, uuid4()]) + + def testSendMap(self): + self.checkContent({"testSendMap": uuid4(), "pie": "blueberry", "pi": 3.14}) + class MessageTests(Base): def testCreateString(self): |