Skip to content

Commit 20135e8

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent efc469d commit 20135e8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/test_client_functional.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5589,7 +5589,7 @@ async def handler(request: web.Request) -> web.Response:
55895589

55905590

55915591
async def test_stream_reader_total_raw_bytes(aiohttp_client: AiohttpClient) -> None:
5592-
""" Test whether StreamReader.total_raw_bytes returns the number of bytes downloaded """
5592+
"""Test whether StreamReader.total_raw_bytes returns the number of bytes downloaded"""
55935593
source_data = b"@dKal^pH>1h|YW1:c2J$" * 4096
55945594

55955595
async def handler(request: web.Request) -> web.Response:
@@ -5603,21 +5603,27 @@ async def handler(request: web.Request) -> web.Response:
56035603
client = await aiohttp_client(app)
56045604

56055605
# Check for decompressed data
5606-
async with client.get("/", headers={"Accept-Encoding": "gzip"}, auto_decompress=True) as resp:
5606+
async with client.get(
5607+
"/", headers={"Accept-Encoding": "gzip"}, auto_decompress=True
5608+
) as resp:
56075609
assert resp.headers["Content-Encoding"] == "gzip"
56085610
data = await resp.content.read()
56095611
assert len(data) == len(source_data)
56105612
assert resp.content.total_raw_bytes == int(resp.headers["Content-Length"])
56115613

56125614
# Check for compressed data
5613-
async with client.get("/", headers={"Accept-Encoding": "gzip"}, auto_decompress=False) as resp:
5615+
async with client.get(
5616+
"/", headers={"Accept-Encoding": "gzip"}, auto_decompress=False
5617+
) as resp:
56145618
assert resp.headers["Content-Encoding"] == "gzip"
56155619
data = await resp.content.read()
56165620
assert resp.content.total_raw_bytes == len(data)
56175621
assert resp.content.total_raw_bytes == int(resp.headers["Content-Length"])
56185622

56195623
# Check for non-compressed data
5620-
async with client.get("/", headers={"Accept-Encoding": "identity"}, auto_decompress=True) as resp:
5624+
async with client.get(
5625+
"/", headers={"Accept-Encoding": "identity"}, auto_decompress=True
5626+
) as resp:
56215627
assert "Content-Encoding" not in resp.headers
56225628
data = await resp.content.read()
56235629
assert resp.content.total_raw_bytes == len(data)

0 commit comments

Comments
 (0)