summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Ross <jross@apache.org>2013-04-23 21:28:35 +0000
committerJustin Ross <jross@apache.org>2013-04-23 21:28:35 +0000
commit0d3b8ef91982b687ced6cfa24ff95e28143774d7 (patch)
treefed193b54e575eaabb156d6fd7a8413096af6431
parent3b0c3eb1c32102f65e4b63945c90bf4e706aa200 (diff)
downloadqpid-python-0d3b8ef91982b687ced6cfa24ff95e28143774d7.tar.gz
QPID-4140: Use the session.acked list to determine the number of unsettled messages; a patch from Ernie Allen
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1471150 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/python/qpid/messaging/endpoints.py2
-rw-r--r--qpid/python/qpid/tests/messaging/endpoints.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/qpid/python/qpid/messaging/endpoints.py b/qpid/python/qpid/messaging/endpoints.py
index 143daf616a..89db45af1b 100644
--- a/qpid/python/qpid/messaging/endpoints.py
+++ b/qpid/python/qpid/messaging/endpoints.py
@@ -988,7 +988,7 @@ class Receiver(Endpoint, object):
"""
Returns the number of acknowledged messages awaiting confirmation.
"""
- return len([m for m in self.acked if m._receiver is self])
+ return len([m for m in self.session.acked if m._receiver is self])
@synchronized
def available(self):
diff --git a/qpid/python/qpid/tests/messaging/endpoints.py b/qpid/python/qpid/tests/messaging/endpoints.py
index a82a9e95ed..cb924dc096 100644
--- a/qpid/python/qpid/tests/messaging/endpoints.py
+++ b/qpid/python/qpid/tests/messaging/endpoints.py
@@ -890,7 +890,10 @@ class ReceiverTests(Base):
self.assertEmpty(rb2)
self.drain(self.rcv, expected=[])
- # XXX: need testUnsettled()
+ def testUnsettled(self):
+ # just tests the code path and not the value
+ rcv = self.ssn.receiver('test-receiver-unsettled-queue; {create: always, delete: always}')
+ rcv.unsettled()
def unreliabilityTest(self, mode="unreliable"):
msgs = [self.message("testUnreliable", i) for i in range(3)]