@defer.inlineCallbacks
    def test_ESME_RINVESMCLASS_from_script(self):
        _ic = self.stats_smpps.get('interceptor_count')
        _iec = self.stats_smpps.get('interceptor_error_count')

        # Re-provision interceptor with script returning a ESME_RINVESMCLASS
        # Connect to RouterPB
        yield self.connect('127.0.0.1', self.pbPort)
        mt_interceptor = MTInterceptorScript(self.return_ESME_RINVESMCLASS)
        yield self.mtinterceptor_add(DefaultInterceptor(mt_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()

        # Bind
        yield self.smppc_factory.connectAndBind()

        # Install mocks
        self.smpps_factory.lastProto.sendPDU = mock.Mock(wraps=self.smpps_factory.lastProto.sendPDU)

        # Send a SMS MT through smpps interface
        yield self.smppc_factory.lastProto.sendDataRequest(self.SubmitSmPDU)

        # Wait 3 seconds for submit_sm_resp
        yield waitFor(3)

        # Unbind & Disconnect
        yield self.smppc_factory.smpp.unbindAndDisconnect()
        yield self.stopSmppClientConnectors()

        # Run tests on final destination smpp server (third party mocker)
        self.assertEqual(0, len(self.SMSCPort.factory.lastClient.submitRecords))
        # Run tests on Jasmin's SMPPs
        self.assertEqual(self.smpps_factory.lastProto.sendPDU.call_count, 2)
        # smpps response was a submit_sm_resp with ESME_ROK
        response_pdu = self.smpps_factory.lastProto.sendPDU.call_args_list[0][0][0]
        self.assertEqual(response_pdu.id, pdu_types.CommandId.submit_sm_resp)
        self.assertEqual(response_pdu.seqNum, 2)
        self.assertEqual(response_pdu.status, pdu_types.CommandStatus.ESME_RINVESMCLASS)
        self.assertTrue(response_pdu.params not in 'message_id')
        self.assertEqual(_ic, self.stats_smpps.get('interceptor_count'))
        self.assertEqual(_iec+1, self.stats_smpps.get('interceptor_error_count'))
dataset/ETHPy150Open jookies/jasmin/jasmin/routing/test/test_router_smpps_interception.py/SmppsSubmitSmInterceptionTestCases.test_ESME_RINVESMCLASS_from_script/swapped operands of `not in`