summaryrefslogtreecommitdiff
path: root/python
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
commit0796adef04162f4f3176a707ee9e50862f263292 (patch)
treea534516c6001194ddb1faf4b3fc3b426e5ed796e /python
parent5636a3b148b8e8dbdc17cfc4a68da276e7c82ed1 (diff)
downloadqpid-python-0796adef04162f4f3176a707ee9e50862f263292.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/qpid@1471150 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid/messaging/endpoints.py2
-rw-r--r--python/qpid/tests/messaging/endpoints.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/python/qpid/messaging/endpoints.py b/python/qpid/messaging/endpoints.py
index 143daf616a..89db45af1b 100644
--- a/python/qpid/messaging/endpoints.py
+++ b/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/python/qpid/tests/messaging/endpoints.py b/python/qpid/tests/messaging/endpoints.py
index a82a9e95ed..cb924dc096 100644
--- a/python/qpid/tests/messaging/endpoints.py
+++ b/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)]