def test_pendingCallbacksClearQueueAndMoreRunsRunAdditionalQueuedOnMoreCompletions(self):
        numExtras = len(self.extraTransmitIds)
        self.test_extraPendingCallbackCompletionsDoNothing()
        # Add more transmits to reach MAX_PENDING_TRANSMITS again
        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 + numExtras, len(self.testTrans.intents))
        self.assertEqual(numExtras, len([I for I in self.testTrans.intents
                                         if I.message in self.extraTransmitIds]))
        # Now send more and make sure they are queued
        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]))
        # And verify that more completions cause the newly Queued to be run
        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 == self.extraTransmitIds]))
dataset/ETHPy150Open godaddy/Thespian/thespian/system/transport/test/test_asyncBase.py/TestAsyncTransportBase.test_pendingCallbacksClearQueueAndMoreRunsRunAdditionalQueuedOnMoreCompletions/operator `in` -> `==`