当前位置: 首页>>代码示例>>Python>>正文


Python TransmitIntent.completionCallback方法代码示例

本文整理汇总了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()
开发者ID:liuzhijun,项目名称:Thespian,代码行数:9,代码来源:test_transmitintent.py

示例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)])
开发者ID:liuzhijun,项目名称:Thespian,代码行数:15,代码来源:test_transmitintent.py

示例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)])
开发者ID:liuzhijun,项目名称:Thespian,代码行数:16,代码来源:test_transmitintent.py

示例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)]
开发者ID:godaddy,项目名称:Thespian,代码行数:17,代码来源:test_transmitintent.py

示例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)]
开发者ID:godaddy,项目名称:Thespian,代码行数:19,代码来源:test_transmitintent.py


注:本文中的thespian.system.transport.TransmitIntent.completionCallback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。