def testListOfUsers(self, name=None, email=None): try: self.assertGreater(self.listUsers(name, email), 0) return self.qBase.toJson(self.__listOfUsers) except AssertionError as ae: self.__loggerMySQL.testInsertLog(ae.args[0], kindOfLog.INFO(), traceback.format_exc()) return self.qBase.toJson(self.__listOfUsers)
def testListOf(self, ID_EVENTO): try: self.assertGreater(self.listEvento(ID_EVENTO), 0) return self.qBase.toJson(self.__listOf) except AssertionError as ae: self.__loggerMySQL.testInsertLog(ae.args[0], kindOfLog.INFO(), traceback.format_exc()) return self.qBase.toJson(self.__listOf)
def testSaveUser(self, userMap=mapUser): try: self.assertTrue(self.saveUser(userMap)) self.__loggerMySQL.testInsertLog('Ok', kindOfLog.INFO(), 'Insert Ok') return self.qBase.toJsonRoute("Ok", 200) except AssertionError as ae: _message = ae.args[0] self.__loggerMySQL.testInsertLog(_message, kindOfLog.ERROR(), traceback.format_exc()) return self.qBase.toJsonRoute(_message, 500)
def testSave(self, empresa=mapEmpresaContratante): try: self.assertTrue(self.saveEmpresa(empresa)) self.__loggerMySQL.testInsertLog('Ok', kindOfLog.INFO(), 'Insert Ok') return self.qBase.toJsonRoute("Ok", 200) except AssertionError as ae: _message = ae.args[0] self.__loggerMySQL.testInsertLog(_message, kindOfLog.ERROR(), traceback.format_exc()) return self.qBase.toJsonRoute(_message, 500)
def testAdicionaPresenca(self, ID_EVENTO, ID_CONVIDADO): try: self.assertTrue(self.adicionaPresenca(ID_EVENTO, ID_CONVIDADO)) self.__loggerMySQL.testInsertLog('Ok', kindOfLog.INFO(), 'Insert Ok') return self.qBase.toJsonRoute("Ok", 200) except AssertionError as ae: _message = ae.args[0] self.__loggerMySQL.testInsertLog(_message, kindOfLog.ERROR(), traceback.format_exc()) return self.qBase.toJsonRoute(_message, 500)
def testSave(self, evento=mapEvento, convidado=mapConvidado): try: self.assertTrue(self.saveEvento(evento, convidado)) self.__loggerMySQL.testInsertLog('Ok', kindOfLog.INFO(), 'Insert Ok') return self.qBase.toJsonRoute(str(self.__ID_EVENTO), 200) except AssertionError as ae: _message = ae.args[0] self.__loggerMySQL.testInsertLog(_message, kindOfLog.ERROR(), traceback.format_exc()) return self.qBase.toJsonRoute(_message, 500)