Skip to content

Commit

Permalink
Format with black 23.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Jul 3, 2023
1 parent cdccbef commit d2fef11
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions examples/trio-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def format_date_time(dt=None):
# I/O adapter: h11 <-> trio
################################################################


# The core of this could be factored out to be usable for trio-based clients
# too, as well as servers. But as a simplified pedagogical example we don't
# attempt this here.
Expand Down Expand Up @@ -212,6 +213,7 @@ def info(self, *args):
# Server main loop
################################################################


# General theory:
#
# If everything goes well:
Expand Down Expand Up @@ -276,6 +278,7 @@ async def http_serve(stream):
# Actual response handlers
################################################################


# Helper function
async def send_simple_response(wrapper, status_code, content_type, body):
wrapper.info("Sending", status_code, "response with", len(body), "bytes")
Expand Down
1 change: 1 addition & 0 deletions h11/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class PAUSED(Sentinel, metaclass=Sentinel):
# - Apache: <8 KiB per line>
DEFAULT_MAX_INCOMPLETE_EVENT_SIZE = 16 * 1024


# RFC 7230's rules for connection lifecycles:
# - If either side says they want to close the connection, then the connection
# must close.
Expand Down
4 changes: 2 additions & 2 deletions h11/tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def test_pipelining() -> None:


def test_protocol_switch() -> None:
for (req, deny, accept) in [
for req, deny, accept in [
(
Request(
method="CONNECT",
Expand Down Expand Up @@ -721,7 +721,7 @@ def setup() -> ConnectionPair:
def test_close_simple() -> None:
# Just immediately closing a new connection without anything having
# happened yet.
for (who_shot_first, who_shot_second) in [(CLIENT, SERVER), (SERVER, CLIENT)]:
for who_shot_first, who_shot_second in [(CLIENT, SERVER), (SERVER, CLIENT)]:

def setup() -> ConnectionPair:
p = ConnectionPair()
Expand Down
4 changes: 2 additions & 2 deletions h11/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ def check(got: Any) -> None:


def test_writers_simple() -> None:
for ((role, state), event, binary) in SIMPLE_CASES:
for (role, state), event, binary in SIMPLE_CASES:
tw(WRITERS[role, state], event, binary)


def test_readers_simple() -> None:
for ((role, state), event, binary) in SIMPLE_CASES:
for (role, state), event, binary in SIMPLE_CASES:
tr(READERS[role, state], binary, event)


Expand Down

0 comments on commit d2fef11

Please sign in to comment.