本文整理汇总了Python中thespian.system.transport.TransmitIntent.completionCallback方法的典型用法代码示例。如果您正苦于以下问题:Python TransmitIntent.completionCallback方法的具体用法?Python TransmitIntent.completionCallback怎么用?Python TransmitIntent.completionCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thespian.system.transport.TransmitIntent
的用法示例。
在下文中一共展示了TransmitIntent.completionCallback方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testTransmitIntentCallbackFailureFailed
# 需要导入模块: from thespian.system.transport import TransmitIntent [as 别名]
# 或者: from thespian.system.transport.TransmitIntent import completionCallback [as 别名]
def testTransmitIntentCallbackFailureFailed(self):
ti = TransmitIntent('addr', 'msg')
ti.result = SendStatus.Failed
# Ensure no exception thrown
ti.completionCallback()
# And again
ti.completionCallback()
示例2: testTransmitIntentCallbackFailureFailedWithTarget
# 需要导入模块: from thespian.system.transport import TransmitIntent [as 别名]
# 或者: from thespian.system.transport.TransmitIntent import completionCallback [as 别名]
def testTransmitIntentCallbackFailureFailedWithTarget(self):
self.successes = []
self.failures = []
ti = TransmitIntent('addr', 'msg', onSuccess = self._success, onError = self._failed)
ti.result = SendStatus.Failed
# Ensure no exception thrown
ti.completionCallback()
self.assertEqual(self.successes, [])
self.assertEqual(self.failures, [(SendStatus.Failed, ti)])
# And again
ti.completionCallback()
self.assertEqual(self.successes, [])
self.assertEqual(self.failures, [(SendStatus.Failed, ti)])
示例3: testTransmitIntentCallbackFailureNotSentWithChangedTargetsAdded
# 需要导入模块: from thespian.system.transport import TransmitIntent [as 别名]
# 或者: from thespian.system.transport.TransmitIntent import completionCallback [as 别名]
def testTransmitIntentCallbackFailureNotSentWithChangedTargetsAdded(self):
self.successes = []
self.failures = []
ti = TransmitIntent('addr', 'msg', onSuccess = self._success, onError = self._failed)
ti.result = SendStatus.NotSent
# Ensure no exception thrown
ti.completionCallback()
self.assertEqual(self.successes, [])
self.assertEqual(self.failures, [(SendStatus.NotSent, ti)])
# And again
ti.addCallback(self._success, self._failed)
ti.completionCallback()
self.assertEqual(self.successes, [])
self.assertEqual(self.failures, [(SendStatus.NotSent, ti), (SendStatus.NotSent, ti)])
示例4: testTransmitIntentCallbackFailureNotSentWithTarget
# 需要导入模块: from thespian.system.transport import TransmitIntent [as 别名]
# 或者: from thespian.system.transport.TransmitIntent import completionCallback [as 别名]
def testTransmitIntentCallbackFailureNotSentWithTarget(self):
self.successes = []
self.failures = []
ti = TransmitIntent('addr', 'msg',
onSuccess = self._success,
onError = self._failed)
ti.result = SendStatus.NotSent
# Ensure no exception thrown
ti.completionCallback()
assert self.successes == []
assert self.failures == [(SendStatus.NotSent, ti)]
# And again
ti.completionCallback()
assert self.successes == []
assert self.failures == [(SendStatus.NotSent, ti)]
示例5: testTransmitIntentCallbackFailureFailedWithChangedTargetsAdded
# 需要导入模块: from thespian.system.transport import TransmitIntent [as 别名]
# 或者: from thespian.system.transport.TransmitIntent import completionCallback [as 别名]
def testTransmitIntentCallbackFailureFailedWithChangedTargetsAdded(self):
self.successes = []
self.failures = []
ti = TransmitIntent('addr', 'msg',
onSuccess = self._success,
onError = self._failed)
ti.result = SendStatus.Failed
# Ensure no exception thrown
ti.completionCallback()
assert self.successes == []
assert self.failures == [(SendStatus.Failed, ti)]
# And again
ti.addCallback(self._success, self._failed)
ti.completionCallback()
assert self.successes == []
assert self.failures == [(SendStatus.Failed, ti),
(SendStatus.Failed, ti)]