diff options
author | Rafael H. Schloming <rhs@apache.org> | 2010-01-22 14:26:11 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2010-01-22 14:26:11 +0000 |
commit | 631dfd9bd1b96540ccdc5d2419f2c47a9e15253e (patch) | |
tree | de56c5158b51649270fbcc194d33cd3bbd5c606f /python/qpid/tests/messaging.py | |
parent | 578ab4e8631e778bfdbb4f88b030314471394d53 (diff) | |
download | qpid-python-631dfd9bd1b96540ccdc5d2419f2c47a9e15253e.tar.gz |
added boolean literals to java & python address parser; added validation to python address usage
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@902095 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/tests/messaging.py')
-rw-r--r-- | python/qpid/tests/messaging.py | 32 |
1 files changed, 29 insertions, 3 deletions
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, " |