Exemplo n.º 1
0
 def setUp(self):
     yield HappySMSCTestCase.setUp(self)
     
     # Init
     self.group1 = Group('g1')
     self.user1 = User('1', self.group1, 'u1', 'password')
     self.c1 = SmppClientConnector('smpp_c1')
Exemplo n.º 2
0
    def setUp(self):
        yield HappySMSCTestCase.setUp(self)

        # Init
        self.group1 = Group('g1')
        self.user1 = User('1', self.group1, 'u1', 'password')
        self.c1 = SmppClientConnector('smpp_c1')
Exemplo n.º 3
0
    def setUp(self):
        yield HappySMSCTestCase.setUp(self)

        # Start http servers
        self.AckServerResource = AckServer()
        self.AckServer = reactor.listenTCP(0,
                                           server.Site(self.AckServerResource))
Exemplo n.º 4
0
    def setUp(self, interceptorpb_client=None):
        yield HappySMSCTestCase.setUp(self)

        self.encoder = pdu_encoding.PDUEncoder()

        # SMPPServerConfig init
        self.smpps_config = SMPPServerConfig()

        # Portal init
        _portal = portal.Portal(SmppsRealm(self.smpps_config.id,
                                           self.pbRoot_f))
        _portal.registerChecker(RouterAuthChecker(self.pbRoot_f))

        # Install mocks
        self.clientManager_f.perspective_submit_sm = mock.Mock(
            wraps=self.clientManager_f.perspective_submit_sm)

        # SMPPServerFactory init
        self.smpps_factory = LastProtoSMPPServerFactory(
            self.smpps_config,
            auth_portal=_portal,
            RouterPB=self.pbRoot_f,
            SMPPClientManagerPB=self.clientManager_f,
            interceptorpb_client=interceptorpb_client)
        self.smpps_port = reactor.listenTCP(self.smpps_config.port,
                                            self.smpps_factory)

        # Init protocol for testing
        self.smpps_proto = self.smpps_factory.buildProtocol(('127.0.0.1', 0))
        self.smpps_tr = proto_helpers.StringTransport()
        self.smpps_proto.makeConnection(self.smpps_tr)

        # Add SMPPs factory to DLRThrower
        self.DLRThrower.addSmpps(self.smpps_factory)

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

        # PDUs used for tests
        self.SubmitSmPDU = SubmitSM(
            source_addr='1234',
            destination_addr='4567',
            short_message='hello !',
            seqNum=1,
        )
        self.DeliverSmPDU = DeliverSM(
            source_addr='4567',
            destination_addr='1234',
            short_message='any content',
            seqNum=1,
        )
        self.DataSmPDU = DataSM(
            source_addr='4567',
            destination_addr='1234',
            message_payload='any content',
            seqNum=1,
        )
Exemplo n.º 5
0
    def setUp(self, interceptorpb_client = None):
        yield HappySMSCTestCase.setUp(self)

        self.encoder = pdu_encoding.PDUEncoder()

        # SMPPServerConfig init
        self.smpps_config = SMPPServerConfig()

        # Portal init
        _portal = portal.Portal(SmppsRealm(self.smpps_config.id, self.pbRoot_f))
        _portal.registerChecker(RouterAuthChecker(self.pbRoot_f))

        # Install mocks
        self.clientManager_f.perspective_submit_sm = mock.Mock(wraps=self.clientManager_f.perspective_submit_sm)

        # SMPPServerFactory init
        self.smpps_factory = LastProtoSMPPServerFactory(self.smpps_config,
                                                        auth_portal = _portal,
                                                        RouterPB = self.pbRoot_f,
                                                        SMPPClientManagerPB = self.clientManager_f,
                                                        interceptorpb_client = interceptorpb_client)
        self.smpps_port = reactor.listenTCP(self.smpps_config.port, self.smpps_factory)

        # Init protocol for testing
        self.smpps_proto = self.smpps_factory.buildProtocol(('127.0.0.1', 0))
        self.smpps_tr = proto_helpers.StringTransport()
        self.smpps_proto.makeConnection(self.smpps_tr)

        # Add SMPPs factory to DLRThrower
        self.DLRThrower.addSmpps(self.smpps_factory)

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

        # PDUs used for tests
        self.SubmitSmPDU = SubmitSM(
            source_addr = '1234',
            destination_addr = '4567',
            short_message = 'hello !',
            seqNum = 1,
        )
        self.DeliverSmPDU = DeliverSM(
            source_addr='4567',
            destination_addr='1234',
            short_message='any content',
            seqNum = 1,
        )
        self.DataSmPDU = DataSM(
            source_addr='4567',
            destination_addr='1234',
            message_payload='any content',
            seqNum = 1,
        )
 def setUp(self):
     yield HappySMSCTestCase.setUp(self)
     
     # Start http servers
     self.AckServerResource = AckServer()
     self.AckServer = reactor.listenTCP(0, server.Site(self.AckServerResource))