@defer.inlineCallbacks
    def test_HTTP_300_from_script(self):

        # Re-provision interceptor with script returning a HTTP 300
        # Connect to RouterPB
        yield self.connect('127.0.0.1', self.pbPort)
        mo_interceptor = MOInterceptorScript(self.return_HTTP_300)
        yield self.mointerceptor_add(DefaultInterceptor(mo_interceptor), 0)
        # Disconnect from RouterPB
        self.disconnect()

        # Connect to InterceptorPB
        yield self.ipb_connect()

        yield self.connect('127.0.0.1', self.pbPort)
        yield self.prepareRoutingsAndStartConnector()

        _ic = self.stats_smppc.get('interceptor_count')
        _iec = self.stats_smppc.get('interceptor_error_count')

        # 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
        yield self.triggerDeliverSmFromSMSC([self.DeliverSmPDU])

        # Run tests on downstream smpp client
        self.assertEqual(self.smppc_factory.lastProto.PDUDataRequestReceived.call_count, 0)
        # Run tests on upstream smpp client
        self.assertEqual(len(self.SMSCPort.factory.lastClient.pduRecords), 2)
        sent_back_resp = self.SMSCPort.factory.lastClient.pduRecords[1]
        self.assertEqual(sent_back_resp.id, pdu_types.CommandId.deliver_sm_resp)
        self.assertEqual(sent_back_resp.status, pdu_types.CommandStatus.ESME_RUNKNOWNERR)
        self.assertEqual(_ic, self.stats_smppc.get('interceptor_count'))
        self.assertEqual(_iec+1, self.stats_smppc.get('interceptor_error_count'))

        # Unbind and disconnect
        yield self.smppc_factory.smpp.unbindAndDisconnect()
        yield self.stopSmppClientConnectors()
Run a shell command given the command's parsed command line
dataset/ETHPy150Open jookies/jasmin/jasmin/routing/test/test_router_smppc_interception.py/SmppcDeliverSmInterceptorPBTestCases.test_HTTP_300_from_script--crossover with--dataset/ETHPy150Open ga4gh/server/scripts/utils.py/runCommandSplits