MCPcopy Create free account
hub / github.com/apache/qpid-proton / _testDisposition

Method _testDisposition

python/tests/proton_tests/engine.py:2322–2374  ·  view source on GitHub ↗
(self, count=1, tag="tag%i", type=None, value=None)

Source from the content-addressed store, hash-verified

2320 self.cleanup()
2321
2322 def _testDisposition(self, count=1, tag="tag%i", type=None, value=None):
2323 assert type is not None
2324 if value is None:
2325 value = NoValue()
2326
2327 snd, rcv = self.link("test-link")
2328 snd.open()
2329 rcv.open()
2330
2331 snd_deliveries = []
2332 for i in range(count):
2333 d = snd.delivery(tag % i)
2334 snd_deliveries.append(d)
2335 snd.advance()
2336
2337 rcv.flow(count)
2338 self.pump()
2339
2340 rcv_deliveries = []
2341 for i in range(count):
2342 d = rcv.current
2343 assert d.tag == (tag % i)
2344 rcv_deliveries.append(d)
2345 rcv.advance()
2346
2347 for d in rcv_deliveries:
2348 value.apply(d.local)
2349 d.update(type)
2350
2351 self.pump()
2352
2353 for d in snd_deliveries:
2354 assert d.remote_state == type
2355 assert d.remote.type == type
2356 value.check(d.remote)
2357 value.apply(d.local)
2358 d.update(type)
2359
2360 self.pump()
2361
2362 for d in rcv_deliveries:
2363 assert d.remote_state == type
2364 assert d.remote.type == type
2365 value.check(d.remote)
2366
2367 for d in snd_deliveries:
2368 d.settle()
2369
2370 self.pump()
2371
2372 for d in rcv_deliveries:
2373 assert d.settled, d.settled
2374 d.settle()
2375
2376 def testAccepted(self):
2377 self._testDisposition(type=Disposition.ACCEPTED)

Callers 8

testAcceptedMethod · 0.95
testReceivedMethod · 0.95
testRejectedMethod · 0.95
testReleasedMethod · 0.95
testModifiedMethod · 0.95
testCustomMethod · 0.95
testEmptyCustomMethod · 0.95
testNullCustomMethod · 0.95

Calls 13

applyMethod · 0.95
checkMethod · 0.95
NoValueClass · 0.85
rangeFunction · 0.85
advanceMethod · 0.80
linkMethod · 0.45
openMethod · 0.45
deliveryMethod · 0.45
appendMethod · 0.45
flowMethod · 0.45
pumpMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected