From 82fd43ffbe33ed0e368ea70ccbb6963994a1f5ba Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Thu, 3 Sep 2009 18:22:10 +0000 Subject: added timeout option to send git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@811066 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/tests/messaging.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'python/qpid/tests') diff --git a/python/qpid/tests/messaging.py b/python/qpid/tests/messaging.py index d734bb421f..7623c1f93b 100644 --- a/python/qpid/tests/messaging.py +++ b/python/qpid/tests/messaging.py @@ -599,6 +599,22 @@ class SenderTests(Base): def testSendAsyncCapacityUNLIMITED(self): self.asyncTest(UNLIMITED) + def testCapacityTimeout(self): + self.snd.capacity = 1 + msgs = [] + caught = False + while len(msgs) < 100: + m = self.content("testCapacity", len(msgs)) + try: + self.snd.send(m, sync=False, timeout=0) + msgs.append(m) + except InsufficientCapacity: + caught = True + break + self.drain(self.rcv, expected=msgs) + self.ssn.acknowledge() + assert caught, "did not exceed capacity" + class MessageTests(Base): def testCreateString(self): -- cgit v1.2.1