diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/tests_0-9/broker.py | 17 |
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) |
