summaryrefslogtreecommitdiff
path: root/python/qpid
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2011-03-17 21:04:03 +0000
committerRafael H. Schloming <rhs@apache.org>2011-03-17 21:04:03 +0000
commit0a80ba7c39e720c701468ac2b2736af2b7188d83 (patch)
tree0acc053cec2d3303639061402ddd923f8a77910e /python/qpid
parent15a1bae6b55be7ccd893d9b83e1c0d9b3df0d17c (diff)
downloadqpid-python-0a80ba7c39e720c701468ac2b2736af2b7188d83.tar.gz
only assert if type is specified
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1082697 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid')
-rw-r--r--python/qpid/messaging/driver.py2
-rw-r--r--python/qpid/tests/messaging/endpoints.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/python/qpid/messaging/driver.py b/python/qpid/messaging/driver.py
index 67b0ff909d..78af2827df 100644
--- a/python/qpid/messaging/driver.py
+++ b/python/qpid/messaging/driver.py
@@ -941,7 +941,7 @@ class Engine:
else:
if assrt:
expected = lnk.options.get("node", {}).get("type")
- if type != expected:
+ if expected and type != expected:
err = AssertionFailed(text="expected %s, got %s" % (expected, type))
if err is None:
action(type, subtype)
diff --git a/python/qpid/tests/messaging/endpoints.py b/python/qpid/tests/messaging/endpoints.py
index 1929a47a6b..db5ec03df2 100644
--- a/python/qpid/tests/messaging/endpoints.py
+++ b/python/qpid/tests/messaging/endpoints.py
@@ -1186,13 +1186,16 @@ test-link-bindings-queue; {
snd.send(m)
self.drain(qrcv, expected=msgs)
- def testAssert(self):
+ def testAssert1(self):
try:
snd = self.ssn.sender("amq.topic; {assert: always, node: {type: queue}}")
assert 0, "assertion failed to trigger"
except AssertionFailed, e:
pass
+ def testAssert2(self):
+ snd = self.ssn.sender("amq.topic; {assert: always}")
+
NOSUCH_Q = "this-queue-should-not-exist"
UNPARSEABLE_ADDR = "name/subject; {bad options"
UNLEXABLE_ADDR = "\0x0\0x1\0x2\0x3"