summaryrefslogtreecommitdiff
path: root/python/qpid/tests
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2010-02-17 14:45:52 +0000
committerRafael H. Schloming <rhs@apache.org>2010-02-17 14:45:52 +0000
commit59c781d7a063c242e21dffc40a533a12660253d4 (patch)
treef3ed2b2ad3b59fd7a3d559335fe4ddf5d6cadd45 /python/qpid/tests
parentfbe74f76e112329e0765324860b2eb9c9cccabd7 (diff)
downloadqpid-python-59c781d7a063c242e21dffc40a533a12660253d4.tar.gz
added support for browsing
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@910999 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/tests')
-rw-r--r--python/qpid/tests/messaging.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/python/qpid/tests/messaging.py b/python/qpid/tests/messaging.py
index ce1302a4d6..ca35c56166 100644
--- a/python/qpid/tests/messaging.py
+++ b/python/qpid/tests/messaging.py
@@ -580,6 +580,22 @@ class ReceiverTests(Base):
# XXX: need testClose
+ def testMode(self):
+ msgs = [self.content("testMode", 1),
+ self.content("testMode", 2),
+ self.content("testMode", 3)]
+
+ for m in msgs:
+ self.snd.send(m)
+
+ rb = self.ssn.receiver('test-receiver-queue; {mode: browse}')
+ rc = self.ssn.receiver('test-receiver-queue; {mode: consume}')
+ self.drain(rb, expected=msgs)
+ self.drain(rc, expected=msgs)
+ rb2 = self.ssn.receiver(rb.source)
+ self.assertEmpty(rb2)
+ self.drain(self.rcv, expected=[])
+
class AddressTests(Base):
def setup_connection(self):
@@ -846,6 +862,12 @@ class AddressErrorTests(Base):
self.receiverErrorTest(UNLEXABLE_ADDR, ReceiveError,
lambda e: "unrecognized characters" in str(e))
+ def testInvalidMode(self):
+ # XXX: should have specific exception for this
+ self.receiverErrorTest('name; {mode: "this-is-a-bad-receiver-mode"}',
+ ReceiveError,
+ lambda e: "not in ('browse', 'consume')" in str(e))
+
SENDER_Q = 'test-sender-q; {create: always, delete: always}'
class SenderTests(Base):