diff options
| author | Gordon Sim <gsim@apache.org> | 2007-07-03 15:18:03 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-07-03 15:18:03 +0000 |
| commit | a7a3409349acfaa659e32ddc7e3cf015d03ae749 (patch) | |
| tree | ffe2d21bd7ee09beff8ec4c47319fc0a5119652b /qpid/python/tests_0-9/queue.py | |
| parent | e8f48aa65e92efe48c4e949b263eafd5a756cd26 (diff) | |
| download | qpid-python-a7a3409349acfaa659e32ddc7e3cf015d03ae749.tar.gz | |
Changes to python tests for QPID-533 and QPID-407.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@552872 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/tests_0-9/queue.py')
| -rw-r--r-- | qpid/python/tests_0-9/queue.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/qpid/python/tests_0-9/queue.py b/qpid/python/tests_0-9/queue.py index b94b8b7739..e7fe0b3ed4 100644 --- a/qpid/python/tests_0-9/queue.py +++ b/qpid/python/tests_0-9/queue.py @@ -304,3 +304,37 @@ class QueueTests(TestBase): self.assertChannelException(404, e.args[0]) + def test_autodelete_shared(self): + """ + Test auto-deletion (of non-exclusive queues) + """ + channel = self.channel + other = self.connect() + channel2 = other.channel(1) + channel2.channel_open() + + channel.queue_declare(queue="auto-delete-me", auto_delete=True) + + #consume from both channels + reply = channel.basic_consume(queue="auto-delete-me", no_ack=True) + channel2.basic_consume(queue="auto-delete-me", no_ack=True) + + #implicit cancel + channel2.channel_close() + + #check it is still there + channel.queue_declare(queue="auto-delete-me", passive=True) + + #explicit cancel => queue is now unused again: + channel.basic_cancel(consumer_tag=reply.consumer_tag) + + #NOTE: this assumes there is no timeout in use + + #check that it has gone be declaring passively + try: + channel.queue_declare(queue="auto-delete-me", passive=True) + self.fail("Expected queue to have been deleted") + except Closed, e: + self.assertChannelException(404, e.args[0]) + + |
