def process_request(self, msg): mti = ISO8583Parser.get_MTI(msg) try: handler = self._handlers_mti[mti] except: return "BAD LINE" #The errors should be handled according to doc try: return handler(msg) except AssertionError: return "No esta Logueado" except: return "Error interno"
def test_get_mti_admin_conn_error_len(self): expected = MTI_ADMIN_CONN_ERROR result = ISO8583Parser.get_MTI(MOCK_MESSAGE_ADMIN_CONN_BL) self.assertEquals(result, expected)
def test_get_mti_req_error_len(self): expected = MTI_REQ_ERROR result = ISO8583Parser.get_MTI(MOCK_MESSAGE_REQ_BL) self.assertEquals(result, expected)
def test_get_mti(self): expected = MTI_ADMIN_CONN result = ISO8583Parser.get_MTI(MOCK_MESSAGE_ADMIN_CONN) self.assertEquals(result, expected)