diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2011-03-17 21:04:03 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2011-03-17 21:04:03 +0000 |
| commit | e64bdb7315bb39c42355caa01c66e170ea772581 (patch) | |
| tree | 085b7721e9c9433243119ad6e637006bc8550606 /qpid/python | |
| parent | 5077296848b2f6e2ee89d4c1a7d0022a0e14eb48 (diff) | |
| download | qpid-python-e64bdb7315bb39c42355caa01c66e170ea772581.tar.gz | |
only assert if type is specified
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1082697 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
| -rw-r--r-- | qpid/python/qpid/messaging/driver.py | 2 | ||||
| -rw-r--r-- | qpid/python/qpid/tests/messaging/endpoints.py | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/qpid/python/qpid/messaging/driver.py b/qpid/python/qpid/messaging/driver.py index 67b0ff909d..78af2827df 100644 --- a/qpid/python/qpid/messaging/driver.py +++ b/qpid/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/qpid/python/qpid/tests/messaging/endpoints.py b/qpid/python/qpid/tests/messaging/endpoints.py index 1929a47a6b..db5ec03df2 100644 --- a/qpid/python/qpid/tests/messaging/endpoints.py +++ b/qpid/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" |
