summaryrefslogtreecommitdiff
path: root/qpid/python
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2009-10-28 20:24:51 +0000
committerKim van der Riet <kpvdr@apache.org>2009-10-28 20:24:51 +0000
commit03f30044cd047c423fef86677e74c99eec0b504c (patch)
tree72dfed155a816ae01535ecdfb97eacb4985f213b /qpid/python
parentd39084bb979ff7a39432ba5cecd8c3f097ff3e53 (diff)
downloadqpid-python-03f30044cd047c423fef86677e74c99eec0b504c.tar.gz
Fixed lack of checking for reserved exchange names that start with "amq." according to the AMQP spec. Added a python test for this functionality.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@830751 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
-rw-r--r--qpid/python/tests_0-10/exchange.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/qpid/python/tests_0-10/exchange.py b/qpid/python/tests_0-10/exchange.py
index 738e3c4def..e2c84848f7 100644
--- a/qpid/python/tests_0-10/exchange.py
+++ b/qpid/python/tests_0-10/exchange.py
@@ -271,6 +271,28 @@ class DeclareMethodExchangeFieldReservedRuleTests(TestHelper):
"""
+ def test(self):
+ try:
+ self.session.exchange_declare(exchange="amq.", type="direct")
+ self.fail("Expected not allowed error (530) for exchanges starting with \"amq.\".")
+ except SessionException, e:
+ self.assertEquals(e.args[0].error_code, 530)
+ # connection closed, reopen it
+ self.tearDown()
+ self.setUp()
+ try:
+ self.session.exchange_declare(exchange="amq.abc123", type="direct")
+ self.fail("Expected not allowed error (530) for exchanges starting with \"amq.\".")
+ except SessionException, e:
+ self.assertEquals(e.args[0].error_code, 530)
+ # connection closed, reopen it
+ self.tearDown()
+ self.setUp()
+ # The following should be legal:
+ self.session.exchange_declare(exchange="amq", type="direct")
+ self.session.exchange_declare(exchange=".amq.", type="direct")
+ self.session.exchange_declare(exchange="abc.amq.", type="direct")
+ self.session.exchange_declare(exchange="abc.amq.def", type="direct")
class DeclareMethodTypeFieldTypedRuleTests(TestHelper):