Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
Had a few issues with formatting and the black version, this commit cleans that up.
  • Loading branch information
LucidDan committed Dec 29, 2021
1 parent 732b1e6 commit 2037ec9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions async_asgi_testclient/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
(and in some cases, possible at all) to handle errors in different
ways.
"""
from typing import Optional

from async_asgi_testclient.utils import Message
from typing import Optional


class TestClientError(Exception):
Expand Down
9 changes: 7 additions & 2 deletions async_asgi_testclient/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ async def send_lifespan(self, action):
message = await receive(self._lifespan_output_queue, timeout=self.timeout)

if isinstance(message, Message):
raise TestClientError(f"{message.event} - {message.reason} - {message.task}", message=message)
raise TestClientError(
f"{message.event} - {message.reason} - {message.task}", message=message
)

if message["type"] == f"lifespan.{action}.complete":
pass
Expand Down Expand Up @@ -272,7 +274,10 @@ async def open(
message = await self.wait_response(receive_or_fail, "http.response.start")
response.status_code = message["status"]
response.headers = CIMultiDict(
[(k.decode("utf8"), v.decode("utf8")) for k, v in message.get("headers", [])]
[
(k.decode("utf8"), v.decode("utf8"))
for k, v in message.get("headers", [])
]
)

# Receive initial response body
Expand Down
2 changes: 1 addition & 1 deletion async_asgi_testclient/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async def connect(self):
headers.add("Cookie", cookie_jar.output(header=""))

scope = {
"asgi": {"version": "3.0", },
"asgi": {"version": "3.0"},
"type": "websocket",
"headers": flatten_headers(headers),
"path": path,
Expand Down

0 comments on commit 2037ec9

Please sign in to comment.