

@defer.inlineCallbacks
def test_delivery_multipart_SmppClientConnector(self):
    (yield self.connect('127.0.0.1', self.pbPort))
    (yield self.prepareRoutingsAndStartConnector())
    (yield self.smppc_factory.connectAndBind())
    self.smppc_factory.lastProto.PDUDataRequestReceived = mock.Mock(wraps=self.smppc_factory.lastProto.PDUDataRequestReceived)
    for i in range(10):
        pdu = copy.copy(self.DeliverSmPDU)
        pdu.seqNum += 1
        (yield self.triggerDeliverSmFromSMSC([pdu]))
    self.assertEqual(self.smppc_factory.lastProto.PDUDataRequestReceived.call_count, 10)
    for i in range(10):
        received_pdu = self.smppc_factory.lastProto.PDUDataRequestReceived.call_args_list[i][0][0]
        self.assertEqual(received_pdu.id, pdu_types.CommandId.deliver_sm)
        self.assertEqual(received_pdu.seqNum, (i + 1))
    (yield self.smppc_factory.smpp.unbindAndDisconnect())
    (yield self.stopSmppClientConnectors())

dataset/ETHPy150Open jookies/jasmin/jasmin/routing/test/test_routing_deliver_sm.py DeliverSmSmppThrowingTestCases.test_delivery_multipart_SmppClientConnector/original