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

        # Bind
        yield self.smppc_factory.connectAndBind()

        # Install mocks
        self.smppc_factory.lastProto.PDUDataRequestReceived = mock.Mock(wraps=self.smppc_factory.lastProto.PDUDataRequestReceived)

        # Send a deliver_sm from the SMSC
        DeliverSmPDU = copy.deepcopy(self.DeliverSmPDU)
        DeliverSmPDU.params['network_error_code'] = '\x03\x00\x00'
        yield self.triggerDeliverSmFromSMSC([DeliverSmPDU])

        # Run tests
        self.assertEqual(self.smppc_factory.lastProto.PDUDataRequestReceived.call_count, 1)
        # the received pdu must be our DeliverSmPDU
        received_pdu_1 = self.smppc_factory.lastProto.PDUDataRequestReceived.call_args_list[0][0][0]
        self.assertEqual(received_pdu_1.id, pdu_types.CommandId.deliver_sm)
        self.assertEqual(received_pdu_1.params['network_error_code'], DeliverSmPDU.params['network_error_code'])

        # Unbind and disconnect
        yield self.smppc_factory.smpp.unbindAndDisconnect()
        yield self.stopSmppClientConnectors()
Related to #117
dataset/ETHPy150Open jookies/jasmin/jasmin/routing/test/test_routing_deliver_sm.py/DeliverSmSmppThrowingTestCases.test_delivery_SmppClientConnector_with_network_error_code