Add tests (#1433)
* Add tests for remove_route() * Add tests for sanic/router.py * Add tests for sanic/cookies.py * Disable reset logging in test_logging.py * Add tests for sanic/request.py * Add tests for ContentRangeHandler * Add tests for exception at response middleware * Fix cached_handlers for ErrorHandler.lookup() * Add test for websocket request timeout * Add tests for getting cookies of StreamResponse, Remove some unused variables in tests/test_cookies.py * Add tests for nested error handle
This commit is contained in:
@@ -61,7 +61,7 @@ class ErrorHandler:
|
||||
self.handlers.append((exception, handler))
|
||||
|
||||
def lookup(self, exception):
|
||||
handler = self.cached_handlers.get(exception, self._missing)
|
||||
handler = self.cached_handlers.get(type(exception), self._missing)
|
||||
if handler is self._missing:
|
||||
for exception_class, handler in self.handlers:
|
||||
if isinstance(exception, exception_class):
|
||||
|
||||
@@ -362,8 +362,8 @@ def parse_multipart_form(body, boundary):
|
||||
fields[field_name] = [value]
|
||||
else:
|
||||
logger.debug(
|
||||
"Form-data field does not have a 'name' parameter \
|
||||
in the Content-Disposition header"
|
||||
"Form-data field does not have a 'name' parameter "
|
||||
"in the Content-Disposition header"
|
||||
)
|
||||
|
||||
return fields, files
|
||||
|
||||
Reference in New Issue
Block a user