summaryrefslogtreecommitdiff
path: root/python/tests_0-10/message.py
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-03-11 21:56:49 +0000
committerGordon Sim <gsim@apache.org>2008-03-11 21:56:49 +0000
commit2250ec787ae5fb84fbebfee35bd9925ebd1dd679 (patch)
treedb1768a5f613ca2a70187c52b96896ca1ccdcfdc /python/tests_0-10/message.py
parentae650ea316f73b40db94a02556fd2cb335a7c816 (diff)
downloadqpid-python-2250ec787ae5fb84fbebfee35bd9925ebd1dd679.tar.gz
Enabled tx methods on final 0-10 path and converted tests accordingly
Added read/write- uuid to codec010 git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@636121 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/tests_0-10/message.py')
-rw-r--r--python/tests_0-10/message.py32
1 files changed, 15 insertions, 17 deletions
diff --git a/python/tests_0-10/message.py b/python/tests_0-10/message.py
index d176962b8b..df9fde1593 100644
--- a/python/tests_0-10/message.py
+++ b/python/tests_0-10/message.py
@@ -96,31 +96,29 @@ class MessageTests(TestBase010):
def test_consume_exclusive(self):
"""
- Test that the exclusive flag is honoured in the consume method
+ Test an exclusive consumer prevents other consumer being created
"""
session = self.session
- #setup, declare a queue:
session.queue_declare(queue="test-queue-2", exclusive=True, auto_delete=True)
-
- #check that an exclusive consumer prevents other consumer being created:
- self.subscribe(destination="first", queue="test-queue-2", exclusive=True)
+ session.message_subscribe(destination="first", queue="test-queue-2", exclusive=True)
try:
- self.subscribe(destination="second", queue="test-queue-2")
+ session.message_subscribe(destination="second", queue="test-queue-2")
self.fail("Expected consume request to fail due to previous exclusive consumer")
- except Closed, e:
- self.assertChannelException(403, e.args[0])
-
- #open new session and cleanup last consumer:
- session = self.client.session(2)
- session.session_open()
+ except SessionException, e:
+ self.assertEquals(403, e.args[0].error_code)
- #check that an exclusive consumer cannot be created if a consumer already exists:
- self.subscribe(session, destination="first", queue="test-queue-2")
+ def test_consume_exclusive2(self):
+ """
+ Check that an exclusive consumer cannot be created if a consumer already exists:
+ """
+ session = self.session
+ session.queue_declare(queue="test-queue-2", exclusive=True, auto_delete=True)
+ session.message_subscribe(destination="first", queue="test-queue-2")
try:
- self.subscribe(destination="second", queue="test-queue-2", exclusive=True)
+ session.message_subscribe(destination="second", queue="test-queue-2", exclusive=True)
self.fail("Expected exclusive consume request to fail due to previous consumer")
- except Closed, e:
- self.assertChannelException(403, e.args[0])
+ except SessionException, e:
+ self.assertEquals(403, e.args[0].error_code)
def test_consume_queue_not_found(self):
"""