def testTRXBindRequestInvalidPassword(self): pdu = operations.BindTransceiver( system_id = 'userA', password = '******', seqNum = 1 ) self.proto.dataReceived(self.encoder.encode(pdu)) expected_pdu = operations.BindTransceiverResp(system_id='userA', seqNum=1, status=pdu_types.CommandStatus.ESME_RINVPASWD) self.assertEqual(self.tr.value(), self.encoder.encode(expected_pdu)) connection = self.factory.getBoundConnections('userA') self.assertEqual(connection, None)
def testTRXBindRequest(self): pdu = operations.BindTransceiver( system_id = 'userA', password = '******', seqNum = 1 ) self.proto.dataReceived(self.encoder.encode(pdu)) expected_pdu = operations.BindTransceiverResp(system_id='userA', seqNum=1) self.assertEqual(self.tr.value(), self.encoder.encode(expected_pdu)) connection = self.factory.getBoundConnections('userA') self.assertEqual(connection.system_id, 'userA') self.assertEqual(connection._binds[pdu_types.CommandId.bind_transceiver][0], self.proto)