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)
Example #2
0
 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
Example #3
0
 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
Example #4
0
 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)
 def testTransmitIntentCallbackFailureFailed(self):
     ti = TransmitIntent('addr', 'msg')
     ti.result = SendStatus.Failed
     # Ensure no exception thrown
     ti.completionCallback()
     # And again
     ti.completionCallback()
Example #6
0
 def testTransmitIntentCallbackFailureFailed(self):
     ti = TransmitIntent('addr', 'msg')
     ti.result = SendStatus.Failed
     # Ensure no exception thrown
     ti.completionCallback()
     # And again
     ti.completionCallback()
 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)])
 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)])
Example #9
0
 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)]
 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()
     assert self.successes == []
     assert self.failures == [(SendStatus.Failed, ti)]
     # And again
     ti.completionCallback()
     assert self.successes == []
     assert self.failures == [(SendStatus.Failed, ti)]
Example #11
0
 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()
     self.assertEqual(self.successes, [])
     self.assertEqual(self.failures, [(SendStatus.NotSent, ti)])
     # And again
     ti.completionCallback()
     self.assertEqual(self.successes, [])
     self.assertEqual(self.failures, [(SendStatus.NotSent, ti)])
 def testTransmitIntentCallbackSuccessWithChangedTargetsAdded(self):
     self.successes = []
     self.failures = []
     ti = TransmitIntent('addr', 'msg',
                         onSuccess = self._success,
                         onError = self._failed)
     ti.result = SendStatus.Sent
     # Ensure no exception thrown
     ti.completionCallback()
     assert self.successes == [(SendStatus.Sent, ti)]
     assert self.failures == []
     # And again
     ti.addCallback(self._success, self._failed)
     ti.completionCallback()
     assert self.successes == [(SendStatus.Sent, ti), (SendStatus.Sent, ti)]
     assert self.failures == []
Example #13
0
 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)]
Example #14
0
 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()
     self.assertEqual(self.successes, [])
     self.assertEqual(self.failures, [(SendStatus.Failed, ti)])
     # And again
     ti.addCallback(self._success, self._failed)
     ti.completionCallback()
     self.assertEqual(self.successes, [])
     self.assertEqual(self.failures, [(SendStatus.Failed, ti),
                                      (SendStatus.Failed, ti)])