diff options
| author | Gordon Sim <gsim@apache.org> | 2008-03-07 19:07:32 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-03-07 19:07:32 +0000 |
| commit | 8f4d89dccf62bc6a0a41d9221049b136611e92dc (patch) | |
| tree | beb6def1c353198b6438e25bfaca4c0bf85d8d0b /qpid/python/tests_0-10/queue.py | |
| parent | c8c75599115f4c8e8d610f16aaee77f1aed9324c (diff) | |
| download | qpid-python-8f4d89dccf62bc6a0a41d9221049b136611e92dc.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@634780 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/tests_0-10/queue.py')
| -rw-r--r-- | qpid/python/tests_0-10/queue.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/qpid/python/tests_0-10/queue.py b/qpid/python/tests_0-10/queue.py index 38d7a3291b..97e17048d3 100644 --- a/qpid/python/tests_0-10/queue.py +++ b/qpid/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): """ |
