Author: gsim
Date: Mon Feb 12 09:33:54 2007
New Revision: 506545

URL: http://svn.apache.org/viewvc?view=rev&rev=506545
Log:
Added a test for message_reject.


Modified:
    incubator/qpid/branches/qpid.0-9/python/tests/message.py

Modified: incubator/qpid/branches/qpid.0-9/python/tests/message.py
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/python/tests/message.py?view=diff&rev=506545&r1=506544&r2=506545
==============================================================================
--- incubator/qpid/branches/qpid.0-9/python/tests/message.py (original)
+++ incubator/qpid/branches/qpid.0-9/python/tests/message.py Mon Feb 12 
09:33:54 2007
@@ -621,6 +621,21 @@
         msg = queue.get(timeout=1)
         self.assertEquals(msg.message_id, "empty-msg")
         self.assertDataEquals(channel, msg, "")
+
+    def test_reject(self):
+        channel = self.channel
+        channel.queue_declare(queue = "q", exclusive=True)
+
+        channel.message_consume(queue = "q", destination = "consumer")
+        channel.message_transfer(routing_key = "q", body="blah, blah")
+        msg = self.client.queue("consumer").get(timeout = 5)
+        self.assertEquals(msg.body, "blah, blah")
+        channel.message_cancel(destination = "consumer")
+        msg.reject()
+
+        channel.message_consume(queue = "q", destination = "checker")
+        msg = self.client.queue("checker").get(timeout = 5)
+        self.assertEquals(msg.body, "blah, blah")
         
         
     def assertDataEquals(self, channel, msg, expected):


Reply via email to