예제 #1
0
 def test_receiver_exception(self):
     client = SMPPClientReceiver(self.config, self.barf)
     bindDeferred = client.connectAndBind().addCallback(self.do_test_setup)
     return defer.DeferredList([
         bindDeferred,
         self.disconnectDeferred.addCallback(self.verify),
     ])
예제 #2
0
 def test_receiver_exception(self):
     client = SMPPClientReceiver(self.config, self.barf)
     bindDeferred = client.connectAndBind().addCallback(self.do_test_setup)
     return defer.DeferredList([
         bindDeferred,
         self.disconnectDeferred.addCallback(self.verify),
     ])
예제 #3
0
 def test_receiver_bad_resp_param(self):
     client = SMPPClientReceiver(self.config, self.respondBadParam)
     bindDeferred = client.connectAndBind().addCallback(self.do_test_setup)
     return defer.DeferredList([
         bindDeferred,
         self.disconnectDeferred.addCallback(self.verify),
     ])
예제 #4
0
 def test_receiver_bad_resp_param(self):
     client = SMPPClientReceiver(self.config, self.respondBadParam)
     bindDeferred = client.connectAndBind().addCallback(self.do_test_setup)
     return defer.DeferredList([
         bindDeferred,
         self.disconnectDeferred.addCallback(self.verify),
     ])
예제 #5
0
 def test_receiver_lifecycle(self):
     client = SMPPClientReceiver(self.config, lambda smpp, pdu: None)
     bindDeferred = client.connectAndBind().addCallback(self.do_test_setup)
     return defer.DeferredList([
         bindDeferred,
         self.disconnectDeferred.addCallback(self.verify),
     ])
예제 #6
0
 def test_outbind(self):
     client = SMPPClientReceiver(self.config, self.msgHandler)
     connectDeferred = client.connect()
     return defer.DeferredList([
         connectDeferred,
         self.disconnectDeferred,
     ])
예제 #7
0
 def test_outbind(self):
     client = SMPPClientReceiver(self.config, self.msgHandler)
     connectDeferred = client.connect()
     return defer.DeferredList([
         connectDeferred,
         self.disconnectDeferred,
     ])
예제 #8
0
 def test_receiver_lifecycle(self):
     client = SMPPClientReceiver(self.config, lambda smpp, pdu: None)
     bindDeferred = client.connectAndBind().addCallback(self.do_test_setup)
     return defer.DeferredList([
         bindDeferred,
         self.disconnectDeferred.addCallback(self.verify),
     ])
예제 #9
0
    def test_receiver_lifecycle(self):
        client = SMPPClientReceiver(self.config, lambda smpp, pdu: None)
        smpp = yield client.connectAndBind()

        smpp.PDUReceived = mock.Mock(wraps=smpp.PDUReceived)
        smpp.sendPDU = mock.Mock(wraps=smpp.sendPDU)

        yield smpp.getDisconnectedDeferred()

        self.assertEquals(2, smpp.PDUReceived.call_count)
        self.assertEquals(2, smpp.sendPDU.call_count)
        recv1 = smpp.PDUReceived.call_args_list[0][0][0]
        recv2 = smpp.PDUReceived.call_args_list[1][0][0]
        sent1 = smpp.sendPDU.call_args_list[0][0][0]
        sent2 = smpp.sendPDU.call_args_list[1][0][0]
        self.assertTrue(isinstance(recv1, DeliverSM))
        self.assertEquals(recv1.requireAck(recv1.seqNum), sent1)
        self.assertTrue(isinstance(recv2, Unbind))
        self.assertEquals(recv2.requireAck(recv2.seqNum), sent2)
 def test_receiver_bad_resp_param(self):
     client = SMPPClientReceiver(self.config, self.respondBadParam)
     smpp = yield client.connectAndBind()
     
     smpp.PDUReceived = mock.Mock(wraps=smpp.PDUReceived)
     smpp.sendPDU = mock.Mock(wraps=smpp.sendPDU)
     
     yield smpp.getDisconnectedDeferred()
     
     self.assertEquals(2, smpp.PDUReceived.call_count)
     self.assertEquals(2, smpp.sendPDU.call_count)
     recv1 = smpp.PDUReceived.call_args_list[0][0][0]
     recv2 = smpp.PDUReceived.call_args_list[1][0][0]
     sent1 = smpp.sendPDU.call_args_list[0][0][0]
     sent2 = smpp.sendPDU.call_args_list[1][0][0]
     self.assertTrue(isinstance(recv1, DeliverSM))
     self.assertEquals(recv1.requireAck(recv1.seqNum, CommandStatus.ESME_RX_T_APPN), sent1)
     self.assertTrue(isinstance(sent2, Unbind))
     self.assertTrue(isinstance(recv2, UnbindResp))
 def test_receiver_lifecycle(self):
     client = SMPPClientReceiver(self.config, lambda smpp, pdu: None)
     smpp = yield client.connectAndBind()
     
     smpp.PDUReceived = mock.Mock(wraps=smpp.PDUReceived)
     smpp.sendPDU = mock.Mock(wraps=smpp.sendPDU)
     
     yield smpp.getDisconnectedDeferred()
     
     self.assertEquals(2, smpp.PDUReceived.call_count)
     self.assertEquals(2, smpp.sendPDU.call_count)
     recv1 = smpp.PDUReceived.call_args_list[0][0][0]
     recv2 = smpp.PDUReceived.call_args_list[1][0][0]
     sent1 = smpp.sendPDU.call_args_list[0][0][0]
     sent2 = smpp.sendPDU.call_args_list[1][0][0]
     self.assertTrue(isinstance(recv1, DeliverSM))
     self.assertEquals(recv1.requireAck(recv1.seqNum), sent1)
     self.assertTrue(isinstance(recv2, Unbind))
     self.assertEquals(recv2.requireAck(recv2.seqNum), sent2)
예제 #12
0
    def test_receiver_bad_resp_param(self):
        client = SMPPClientReceiver(self.config, self.respondBadParam)
        smpp = yield client.connectAndBind()

        smpp.PDUReceived = mock.Mock(wraps=smpp.PDUReceived)
        smpp.sendPDU = mock.Mock(wraps=smpp.sendPDU)

        yield smpp.getDisconnectedDeferred()

        self.assertEquals(2, smpp.PDUReceived.call_count)
        self.assertEquals(2, smpp.sendPDU.call_count)
        recv1 = smpp.PDUReceived.call_args_list[0][0][0]
        recv2 = smpp.PDUReceived.call_args_list[1][0][0]
        sent1 = smpp.sendPDU.call_args_list[0][0][0]
        sent2 = smpp.sendPDU.call_args_list[1][0][0]
        self.assertTrue(isinstance(recv1, DeliverSM))
        self.assertEquals(
            recv1.requireAck(recv1.seqNum, CommandStatus.ESME_RX_T_APPN),
            sent1)
        self.assertTrue(isinstance(sent2, Unbind))
        self.assertTrue(isinstance(recv2, UnbindResp))
 def test_bind_receiver_timeout(self):
     client = SMPPClientReceiver(self.config, lambda smpp, pdu: None)
     return self.assertFailure(client.connectAndBind(), SMPPSessionInitTimoutError)
 def test_outbind(self):
     client = SMPPClientReceiver(self.config, self.msgHandler)
     smpp = yield client.connect()
     yield smpp.getDisconnectedDeferred()
 def test_receiver_exception(self):
     client = SMPPClientReceiver(self.config, lambda smpp, pdu: None)
     bindDeferred = client.connectAndBind()
     return self.assertFailure(bindDeferred, SessionStateError)
예제 #16
0
 def test_outbind(self):
     client = SMPPClientReceiver(self.config, self.msgHandler)
     smpp = yield client.connect()
     yield smpp.getDisconnectedDeferred()
예제 #17
0
 def test_bind_receiver_timeout(self):
     client = SMPPClientReceiver(self.config, lambda smpp, pdu: None)
     return self.assertFailure(client.connectAndBind(),
                               SMPPSessionInitTimoutError)
예제 #18
0
 def test_receiver_exception(self):
     client = SMPPClientReceiver(self.config, lambda smpp, pdu: None)
     bindDeferred = client.connectAndBind()
     return self.assertFailure(bindDeferred, SessionStateError)