def testCallSetNotInVariantSetException(self): exception = exceptions.CallSetNotInVariantSetException('csId', 'vsId') response = frontend.handleException(exception) self.assertEquals(response.status_code, 404) gaException = self.getGa4ghException(response.data) self.assertGreater(len(gaException.message), 0) self.assertFalse(frontend.app.log_exception.called)
def testUnknownExceptionBecomesServerError(self): exception = self.UnknownException() response = frontend.handleException(exception) self.assertEquals(response.status_code, 500) gaException = self.getGa4ghException(response.data) self.assertEquals(gaException.message, exceptions.ServerError.message) self.assertTrue(frontend.app.log_exception.called)
def testUnknownExceptionBecomesServerError(self): exception = self.UnknownException() response = frontend.handleException(exception) self.assertEquals(response.status_code, 500) gaException = self.getGa4ghException(response.data) self.assertEquals(gaException.message, exceptions.ServerError.message) self.assertTrue(frontend.app.log_exception.called)
def testNotImplementedException(self): message = "A string unlikely to occur at random." exception = exceptions.NotImplementedException(message) response = frontend.handleException(exception) self.assertEquals(response.status_code, 501) gaException = self.getGa4ghException(response.data) self.assertEquals(gaException.message, message) self.assertFalse(frontend.app.log_exception.called)
def testNotImplementedException(self): message = "A string unlikely to occur at random." exception = exceptions.NotImplementedException(message) response = frontend.handleException(exception) self.assertEquals(response.status_code, 501) gaException = self.getGa4ghException(response.data) self.assertEquals(gaException.message, message) self.assertFalse(frontend.app.log_exception.called)
def testCallSetNotInVariantSetException(self): exception = exceptions.CallSetNotInVariantSetException( 'csId', 'vsId') response = frontend.handleException(exception) self.assertEquals(response.status_code, 404) gaException = self.getGa4ghException(response.data) self.assertGreater(len(gaException.message), 0) self.assertFalse(frontend.app.log_exception.called)
def testObjectNotFoundException(self): exception = exceptions.ObjectNotFoundException() response = frontend.handleException(exception) self.assertEquals(response.status_code, 404) self.assertFalse(frontend.app.log_exception.called)
def testObjectNotFoundException(self): exception = exceptions.ObjectNotFoundException() response = frontend.handleException(exception) self.assertEquals(response.status_code, 404) self.assertFalse(frontend.app.log_exception.called)