summaryrefslogtreecommitdiff
path: root/python/tests_0-9/queue.py
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-07-03 15:18:03 +0000
committerGordon Sim <gsim@apache.org>2007-07-03 15:18:03 +0000
commit84856db9f9312ba65f82a129d7f2761ad80d83fc (patch)
tree33fabe547f097e23033f810d607150c75d2a6343 /python/tests_0-9/queue.py
parent338f2196c07ea6ce2cd40941bca9ef11e95be2bf (diff)
downloadqpid-python-84856db9f9312ba65f82a129d7f2761ad80d83fc.tar.gz
Changes to python tests for QPID-533 and QPID-407.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@552872 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/tests_0-9/queue.py')
-rw-r--r--python/tests_0-9/queue.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/python/tests_0-9/queue.py b/python/tests_0-9/queue.py
index b94b8b7739..e7fe0b3ed4 100644
--- a/python/tests_0-9/queue.py
+++ b/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])
+
+