summaryrefslogtreecommitdiff
path: root/python/tests_0-10/queue.py
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-03-07 19:07:32 +0000
committerGordon Sim <gsim@apache.org>2008-03-07 19:07:32 +0000
commit039d4461a0c1bb44731bbee6df58c0ee0c1673cf (patch)
tree242e9dcd96b51dbe14ea8d474347a00b7c8fe6b5 /python/tests_0-10/queue.py
parent28bb2c5583a4747594c869af46593f223344a043 (diff)
downloadqpid-python-039d4461a0c1bb44731bbee6df58c0ee0c1673cf.tar.gz
Added acquire impl to final 0-10 codepath
Converted some more python tests git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@634780 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/tests_0-10/queue.py')
-rw-r--r--python/tests_0-10/queue.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/python/tests_0-10/queue.py b/python/tests_0-10/queue.py
index 38d7a3291b..97e17048d3 100644
--- a/python/tests_0-10/queue.py
+++ b/python/tests_0-10/queue.py
@@ -20,6 +20,7 @@ from qpid.client import Client, Closed
from qpid.queue import Empty
from qpid.testlib import TestBase010
from qpid.datatypes import Message
+from qpid.session import SessionException
class QueueTests(TestBase010):
"""Tests for 'methods' on the amqp queue 'class'"""
@@ -54,22 +55,31 @@ class QueueTests(TestBase010):
msg = queue.get(timeout=1)
self.assertEqual("four", msg.body)
- #check error conditions (use new sessions):
- session = self.conn.session("error-checker")
+ def test_purge_queue_exists(self):
+ """
+ Test that the correct exception is thrown is no queue exists
+ for the name specified in purge
+ """
+ session = self.session
try:
#queue specified but doesn't exist:
session.queue_purge(queue="invalid-queue")
self.fail("Expected failure when purging non-existent queue")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
+ except SessionException, e:
+ self.assertEquals(404, e.args[0].error_code) #not-found
- session = self.conn.session("error-checker")
+ def test_purge_empty_name(self):
+ """
+ Test that the correct exception is thrown is no queue name
+ is specified for purge
+ """
+ session = self.session
try:
#queue not specified and none previously declared for channel:
session.queue_purge()
self.fail("Expected failure when purging unspecified queue")
- except Closed, e:
- self.assertConnectionException(530, e.args[0])
+ except SessionException, e:
+ self.assertEquals(531, e.args[0].error_code) #illegal-argument
def test_declare_exclusive(self):
"""