@defer.inlineCallbacks
    def test_delivery_of_queued_messages(self):
        yield self.connect('127.0.0.1', self.pbPort)

        localConfig = copy.copy(self.defaultConfig)
        localConfig.id = str(randint(10, 99))
        localConfig.requeue_delay = 2
        localConfig.submit_sm_throughput = 20
        yield self.add(localConfig)

        # Send 180 messages to the queue
        submitCounter = 0
        submit_sm_pdu = copy.copy(self.SubmitSmPDU)
        while submitCounter < 180:
            submit_sm_pdu.params['short_message'] = '%s' % submitCounter
            yield self.submit_sm(localConfig.id, submit_sm_pdu, self.SubmitSmBill)
            submitCounter += 1

        # Wait for 3 seconds
        yield waitFor(3)

        # Start the connector again
        yield self.start(localConfig.id)

        # Wait for 15 seconds, all the rest of the queue must be sent
        yield waitFor(15)

        yield self.stop(localConfig.id)

        # Wait for unbound state
        yield waitFor(2)

        # Assertions
        # Take the lastClient (and unique one) and assert received message
        self.assertEqual(len(self.SMSCPort.factory.lastClient.submitRecords), 180)
Generate a POST request on a resource.
dataset/ETHPy150Open jookies/jasmin/jasmin/managers/test/test_managers.py/ClientConnectorSubmitSmTestCases.test_delivery_of_queued_messages--crossover with--dataset/ETHPy150Open reviewboard/rbtools/rbtools/api/resource.py/_create