summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-05-09 17:00:57 +0000
committerGordon Sim <gsim@apache.org>2007-05-09 17:00:57 +0000
commit9687beb26cdb4069ff86367a143e1b613c2dd62c (patch)
tree4ded0d385c2ad4abacc8a7a759d215503470c95a
parent3a87c67be419a3ae74ea456ae67be5d0f2d2ec92 (diff)
downloadqpid-python-9687beb26cdb4069ff86367a143e1b613c2dd62c.tar.gz
Added test for channel.flow
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@536585 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--python/tests/broker.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/tests/broker.py b/python/tests/broker.py
index d9ac69c5e3..90009b6847 100644
--- a/python/tests/broker.py
+++ b/python/tests/broker.py
@@ -102,3 +102,21 @@ class BrokerTests(TestBase):
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)
+
+