def test_error_handler_status_message(): test_error = web.HTTPError(102, test_message, status_message=test_status) headers, response = run('GET', handler=web.HTTPErrorHandler, handler_args={'error': test_error}) assert response[0] == test_error.code assert response[1] == test_status assert response[2] == test_message.decode() + '\n'
def test_error_handler(): test_error = web.HTTPError(102) headers, response = run('GET', handler=web.HTTPErrorHandler, handler_args={'error': test_error}) assert response[0] == test_error.code assert response[1] == web.status_messages[test_error.code] assert response[2] == str( test_error.code) + ' - ' + web.status_messages[test_error.code] + '\n'
def __init__(self, request, response, groups, error=None): if error is None: error = web.HTTPError(500) MockHTTPHandler.__init__(self, request, response, groups) self.error = error
def respond(self): self.error = web.HTTPError(500, message=test_object, status_message='a') return super().respond()
def respond(self): self.error = web.HTTPError(500) return super().respond()
def check_continue(self): raise web.HTTPError(417)