Skip to content

Commit

Permalink
fix: additonal changes by make fix-import
Browse files Browse the repository at this point in the history
  • Loading branch information
imgurbot12 committed Aug 27, 2020
1 parent 280d953 commit 5890d0c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/test_keep_alive_timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ async def handler3(request):

def test_keep_alive_timeout_reuse():
"""If the server keep-alive timeout and client keep-alive timeout are
both longer than the delay, the client _and_ server will successfully
reuse the existing connection."""
both longer than the delay, the client _and_ server will successfully
reuse the existing connection."""
try:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
Expand Down
7 changes: 3 additions & 4 deletions tests/test_request_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def modify(request, response):
invalid = str(e)

j = loads(response.body)
j['response_mw_valid'] = user
j['response_mw_invalid'] = invalid
j["response_mw_valid"] = user
j["response_mw_invalid"] = invalid
return json(j)

request, response = app.test_client.get("/")
Expand All @@ -59,8 +59,7 @@ def modify(request, response):
"has_missing": False,
"invalid": "'types.SimpleNamespace' object has no attribute 'missing'",
"response_mw_valid": "sanic",
"response_mw_invalid":
"'types.SimpleNamespace' object has no attribute 'missing'"
"response_mw_invalid": "'types.SimpleNamespace' object has no attribute 'missing'",
}


Expand Down
4 changes: 3 additions & 1 deletion tests/test_request_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ async def post(request, id):
assert response.status == 405
assert "Method GET not allowed for URL /post/random_id" in response.text


@pytest.mark.asyncio
async def test_request_stream_unread(app):
"""ensure no error is raised when leaving unread bytes in byte-buffer"""
Expand All @@ -346,13 +347,14 @@ async def test_request_stream_unread(app):
protocol = HttpProtocol(loop=asyncio.get_event_loop(), app=app)
try:
protocol.request = None
protocol._body_chunks.append('this is a test')
protocol._body_chunks.append("this is a test")
await protocol.stream_append()
except AttributeError as e:
err = e

assert err is None and not protocol._body_chunks


def test_request_stream_blueprint(app):
"""for self.is_request_stream = True"""
bp = Blueprint("test_blueprint_request_stream_blueprint")
Expand Down

0 comments on commit 5890d0c

Please sign in to comment.