* 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:
Jacob
2018-12-22 23:21:45 +08:00
committed by Stephen Sadowski
parent d2670664ba
commit 4efd450b32
12 changed files with 554 additions and 16 deletions

View File

@@ -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):

View File

@@ -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