This commit is contained in:
Adam Hopkins
2022-08-20 22:24:43 +03:00
parent beb5c62767
commit c7bac72137
10 changed files with 367 additions and 40 deletions

View File

@@ -150,8 +150,11 @@ def test_app_route_raise_value_error(app):
def test_app_handle_request_handler_is_none(app, monkeypatch):
mock = Mock()
mock.handler = None
def mockreturn(*args, **kwargs):
return Mock(), None, {}
return mock, None, {}
# Not sure how to make app.router.get() return None, so use mock here.
monkeypatch.setattr(app.router, "get", mockreturn)

View File

@@ -1,4 +1,3 @@
from httpx import AsyncByteStream
from sanic_testing.reusable import ReusableClient
from sanic.response import json, text