diff --git a/tests/test_requests.py b/tests/test_requests.py index 11ef8ab..97628f1 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -117,9 +117,11 @@ class TestRequestFactory(unittest.TestCase): request_url = f"{url}?{urlencode(parameters)}" if url else "" parsed = urlparse(request_url) tornado_request = HTTPServerRequest( - method="GET", uri=f"{parsed.path}?{parsed.query}") + method="GET", + uri=f"{parsed.path}?{parsed.query}", + ) tornado_request.protocol = parsed.scheme - tornado_request.host = parsed.netloc.split(':')[0] + tornado_request.host = parsed.netloc.split(":")[0] expected = OpenAPIRequest( full_url_pattern=url, method="get", diff --git a/tornado_openapi3/requests.py b/tornado_openapi3/requests.py index c1e79fb..cfc564f 100644 --- a/tornado_openapi3/requests.py +++ b/tornado_openapi3/requests.py @@ -26,8 +26,8 @@ class TornadoRequestFactory: query_arguments = ImmutableMultiDict() else: path, _, _ = request.full_url().partition("?") - if path == '://': - path = '' + if path == "://": + path = "" query_arguments = ImmutableMultiDict( itertools.chain( *[