Author: gsim
Date: Wed May  9 10:00:57 2007
New Revision: 536585

URL: http://svn.apache.org/viewvc?view=rev&rev=536585
Log:
Added test for channel.flow


Modified:
    incubator/qpid/branches/M2/python/tests/broker.py

Modified: incubator/qpid/branches/M2/python/tests/broker.py
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/python/tests/broker.py?view=diff&rev=536585&r1=536584&r2=536585
==============================================================================
--- incubator/qpid/branches/M2/python/tests/broker.py (original)
+++ incubator/qpid/branches/M2/python/tests/broker.py Wed May  9 10:00:57 2007
@@ -102,3 +102,21 @@
         except Closed, e:
             self.assertConnectionException(504, e.args[0])
 
+    def test_channel_flow(self):
+        channel = self.channel
+        channel.queue_declare(queue="flow_test_queue", exclusive=True)
+        channel.basic_consume(consumer_tag="my-tag", queue="flow_test_queue")
+        incoming = self.client.queue("my-tag")
+
+        channel.channel_flow(active=False)        
+        channel.basic_publish(routing_key="flow_test_queue", 
content=Content("abcdefghijklmnopqrstuvwxyz"))
+        try:
+            incoming.get(timeout=1) 
+            self.fail("Received message when flow turned off.")
+        except Empty: None
+
+        channel.channel_flow(active=True)
+        msg = incoming.get(timeout=1)
+        self.assertEqual("abcdefghijklmnopqrstuvwxyz", msg.content.body)
+
+        


Reply via email to