def test_sendIntentToTransportUpToLimitAndThenQueueInternally(self):

        # Initial transmits are all sent directly
        for count in range(MAX_PENDING_TRANSMITS):
            self.testTrans.scheduleTransmit(
                None,
                TransmitIntent(ActorAddress('me'), 'message%d'%count,
                               self.successCB, self.failureCB))
        self.assertEqual(MAX_PENDING_TRANSMITS, len(self.testTrans.intents))

        # After that transmits are queued because none of the previous have completed
        for count in self.extraTransmitIds:
            self.testTrans.scheduleTransmit(
                None,
                TransmitIntent(ActorAddress(9), count,
                               self.successCB, self.failureCB))
        self.assertEqual(MAX_PENDING_TRANSMITS, len(self.testTrans.intents))
        self.assertFalse([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_sendIntentToTransportUpToLimitAndThenQueueInternally/original