diff options
author | Gordon Sim <gsim@apache.org> | 2011-02-25 17:30:59 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2011-02-25 17:30:59 +0000 |
commit | 53e3ea6ad5a26ed61bcfa810befc7a3a0dc1e3a0 (patch) | |
tree | dfc6cfaca71aff48418c4deb7eb5e6ac9c7b25df /tests | |
parent | 3df4ce2e8ef6f2360e31344661f788808c14cc37 (diff) | |
download | qpid-python-53e3ea6ad5a26ed61bcfa810befc7a3a0dc1e3a0.tar.gz |
QPID-2324: Raise 404 on cancellation if no such subscription exists.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1074642 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/py/qpid_tests/broker_0_10/message.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/src/py/qpid_tests/broker_0_10/message.py b/tests/src/py/qpid_tests/broker_0_10/message.py index e80333a1e6..b46c446833 100644 --- a/tests/src/py/qpid_tests/broker_0_10/message.py +++ b/tests/src/py/qpid_tests/broker_0_10/message.py @@ -245,9 +245,19 @@ class MessageTests(TestBase010): self.fail("Got message after cancellation: " + msg) except Empty: None - #cancellation of non-existant consumers should be handled without error - session.message_cancel(destination="my-consumer") - session.message_cancel(destination="this-never-existed") + #cancellation of non-existant consumers should be result in 404s + try: + session.message_cancel(destination="my-consumer") + self.fail("Expected 404 for recancellation of subscription.") + except SessionException, e: + self.assertEquals(404, e.args[0].error_code) + + session = self.conn.session("alternate-session", timeout=10) + try: + session.message_cancel(destination="this-never-existed") + self.fail("Expected 404 for cancellation of unknown subscription.") + except SessionException, e: + self.assertEquals(404, e.args[0].error_code) def test_ack(self): |