diff options
| author | Justin Ross <jross@apache.org> | 2013-04-23 21:28:35 +0000 |
|---|---|---|
| committer | Justin Ross <jross@apache.org> | 2013-04-23 21:28:35 +0000 |
| commit | 47c0100cc929caa7b4c1e6d3a70a9472bfeb05ac (patch) | |
| tree | a534516c6001194ddb1faf4b3fc3b426e5ed796e /python | |
| parent | 9dc7c351f61d1207b47c28fb612aa651386a8504 (diff) | |
| download | qpid-python-47c0100cc929caa7b4c1e6d3a70a9472bfeb05ac.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.py | 2 | ||||
| -rw-r--r-- | python/qpid/tests/messaging/endpoints.py | 5 |
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)] |
