

def test_transmitsCompletingWithCallbackDoNotQueue(self):
    self.resetCounters()
    for count in range(MAX_PENDING_TRANSMITS):
        self.testTrans.scheduleTransmit(None, TransmitIntent(ActorAddress(self), ('message%d' % count), self.successCB, self.failureCB))
        self.testTrans.forTestingCompleteAPendingIntent(SendStatus.Sent)
    self.assertEqual(self.successCBcalls, MAX_PENDING_TRANSMITS)
    numExtras = len(self.extraTransmitIds)
    for count in self.extraTransmitIds:
        self.testTrans.scheduleTransmit(None, TransmitIntent(ActorAddress(self.testTrans), count, self.successCB, self.failureCB))
        self.testTrans.forTestingCompleteAPendingIntent(SendStatus.Sent)
    self.assertEqual((MAX_PENDING_TRANSMITS + numExtras), len(self.testTrans.intents))
    self.assertEqual(numExtras, len([I for I in self.testTrans.intents if (I.message in self.extraTransmitIds)]))

dataset/ETHPy150Open godaddy/Thespian/thespian/system/transport/test/test_asyncBase.py TestAsyncTransportBase.test_transmitsCompletingWithCallbackDoNotQueue/original