summaryrefslogtreecommitdiff
path: root/python/qpid/tests
diff options
context:
space:
mode:
Diffstat (limited to 'python/qpid/tests')
-rw-r--r--python/qpid/tests/address.py4
-rw-r--r--python/qpid/tests/messaging.py32
2 files changed, 33 insertions, 3 deletions
diff --git a/python/qpid/tests/address.py b/python/qpid/tests/address.py
index 07349d8c6c..7e6c6a5ee5 100644
--- a/python/qpid/tests/address.py
+++ b/python/qpid/tests/address.py
@@ -303,3 +303,7 @@ class AddressTests(ParserBase, Test):
def testMap3(self):
self.valid('name/subject; { "foo.bar": value }',
"name", "subject", {"foo.bar": "value"})
+
+ def testBoolean(self):
+ self.valid("name/subject; { true: True, false: False }",
+ "name", "subject", {"true": True, "false": False})
diff --git a/python/qpid/tests/messaging.py b/python/qpid/tests/messaging.py
index 683bb574ee..ba33ab9e80 100644
--- a/python/qpid/tests/messaging.py
+++ b/python/qpid/tests/messaging.py
@@ -580,12 +580,38 @@ class AddressTests(Base):
def setup_session(self):
return self.conn.session()
- def testBadOption(self):
- snd = self.ssn.sender("test-bad-option; {create: always, node-properties: {this-property-does-not-exist: 3}}")
+ def badOption(self, options, error):
+ snd = self.ssn.sender("test-bad-options-snd; %s" % options)
try:
snd.send("ping")
+ assert False
except SendError, e:
- assert "unrecognized option" in str(e)
+ assert "error in options: %s" % error == str(e), e
+
+ rcv = self.ssn.receiver("test-bad-options-rcv; %s" % options)
+ try:
+ rcv.fetch(timeout=0)
+ assert False
+ except ReceiveError, e:
+ assert "error in options: %s" % error == str(e), e
+
+ def testIllegalKey(self):
+ self.badOption("{create: always, node-properties: "
+ "{this-property-does-not-exist: 3}}",
+ "node-properties: this-property-does-not-exist: "
+ "illegal key")
+
+ def testWrongValue(self):
+ self.badOption("{create: asdf}", "create: asdf not in "
+ "('always', 'sender', 'receiver', 'never')")
+
+ def testWrongType1(self):
+ self.badOption("{node-properties: asdf}",
+ "node-properties: asdf is not a map")
+
+ def testWrongType2(self):
+ self.badOption("{node-properties: {durable: []}}",
+ "node-properties: durable: [] is not a bool")
def testCreateQueue(self):
snd = self.ssn.sender("test-create-queue; {create: always, delete: always, "