コード例 #1
0
ファイル: test_exceptions.py プロジェクト: calbach/server
 def testMappedException(self):
     for originalExceptionClass, mappedExceptionClass in \
             frontendExceptions.exceptionMap.items():
         originalException = originalExceptionClass()
         mappedException = mappedExceptionClass()
         response = frontend.handleException(originalException)
         self.assertEquals(response.status_code, mappedException.httpStatus)
コード例 #2
0
ファイル: test_exceptions.py プロジェクト: ljishen/server
 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)
コード例 #3
0
 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)
コード例 #4
0
 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)
コード例 #5
0
ファイル: test_exceptions.py プロジェクト: ljishen/server
 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)
コード例 #6
0
 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)
コード例 #7
0
ファイル: test_exceptions.py プロジェクト: pashields/server
 def testMappedException(self):
     for originalExceptionClass, mappedExceptionClass in \
             frontendExceptions.exceptionMap.items():
         originalException = originalExceptionClass()
         mappedException = mappedExceptionClass()
         response = frontend.handleException(originalException)
         self.assertEquals(response.status_code, mappedException.httpStatus)
コード例 #8
0
ファイル: test_exceptions.py プロジェクト: calbach/server
 def testUnknownExceptionBecomesServerError(self):
     exception = self.UnknownException()
     response = frontend.handleException(exception)
     self.assertEquals(response.status_code, 500)
コード例 #9
0
ファイル: test_exceptions.py プロジェクト: calbach/server
 def testFrontendException(self):
     exception = frontendExceptions.ObjectNotFoundException()
     response = frontend.handleException(exception)
     self.assertEquals(response.status_code, 404)
コード例 #10
0
 def testObjectNotFoundException(self):
     exception = exceptions.ObjectNotFoundException()
     response = frontend.handleException(exception)
     self.assertEquals(response.status_code, 404)
コード例 #11
0
ファイル: test_exceptions.py プロジェクト: Arc39/server
 def testObjectNotFoundException(self):
     exception = exceptions.ObjectNotFoundException()
     response = frontend.handleException(exception)
     self.assertEquals(response.status_code, 404)
     self.assertFalse(frontend.app.log_exception.called)
コード例 #12
0
ファイル: test_exceptions.py プロジェクト: pashields/server
 def testUnknownExceptionBecomesServerError(self):
     exception = self.UnknownException()
     response = frontend.handleException(exception)
     self.assertEquals(response.status_code, 500)