summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-06-06 16:39:03 +0000
committerGordon Sim <gsim@apache.org>2007-06-06 16:39:03 +0000
commit70a3cdf33b3e38ee26ee2840a55f83ebd26589b4 (patch)
tree07c3dab5cb7d97158737c36efa1caa8d9254c266 /python
parent480e99cfc6071f15bc7135895cf2b60d0dd9c981 (diff)
downloadqpid-python-70a3cdf33b3e38ee26ee2840a55f83ebd26589b4.tar.gz
Merged in channel.flow implementation and interoperability tests.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@544879 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/tests_0-9/broker.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/python/tests_0-9/broker.py b/python/tests_0-9/broker.py
index a978993891..30eda03d48 100644
--- a/python/tests_0-9/broker.py
+++ b/python/tests_0-9/broker.py
@@ -114,3 +114,20 @@ class BrokerTests(TestBase):
self.assertEqual(reply.method.klass.name, "channel")
self.assertEqual(reply.method.name, "ok")
#todo: provide a way to get notified of incoming pongs...
+
+ def test_channel_flow(self):
+ channel = self.channel
+ channel.queue_declare(queue="flow_test_queue", exclusive=True)
+ channel.message_consume(destination="my-tag", queue="flow_test_queue")
+ incoming = self.client.queue("my-tag")
+
+ channel.channel_flow(active=False)
+ channel.message_transfer(routing_key="flow_test_queue", body="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.body)