

def test_pendingCallbacksClearQueueAndMoreRunsRunAdditionalQueuedOnMoreCompletions(self):
    numExtras = len(self.extraTransmitIds)
    self.test_extraPendingCallbackCompletionsDoNothing()
    for _moreExtras in range((numExtras + 3)):
        self.testTrans.forTestingCompleteAPendingIntent(SendStatus.Sent)
    expectedCBCount = (2 * (numExtras + 3))
    self.assertEqual(self.successCBcalls, expectedCBCount)
    self.assertEqual((MAX_PENDING_TRANSMITS + _moreExtras), len(self.testTrans.intents))
    self.assertEqual(numExtras, len([I for I in self.testTrans.intents if (I.message in self.extraTransmitIds)]))
    for count in self.extraTransmitIds:
        self.testTrans.scheduleTransmit(None, TransmitIntent(ActorAddress(3.5), count, self.successCB, self.failureCB))
    self.assertEqual(self.successCBcalls, expectedCBCount)
    self.assertEqual((MAX_PENDING_TRANSMITS + (2 * numExtras)), len(self.testTrans.intents))
    self.assertEqual((2 * numExtras), len([I for I in self.testTrans.intents if (I.message in self.extraTransmitIds)]))
    for _extras in range(numExtras):
        self.testTrans.forTestingCompleteAPendingIntent(SendStatus.Sent)
    expectedCBCount += numExtras
    self.assertEqual(self.successCBcalls, expectedCBCount)
    self.assertEqual(((MAX_PENDING_TRANSMITS + numExtras) + numExtras), len(self.testTrans.intents))
    self.assertEqual((2 * 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_pendingCallbacksClearQueueAndMoreRunsRunAdditionalQueuedOnMoreCompletions/VarMisuse@81/146 `numExtras`->`_moreExtras`