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