MCPcopy
hub / github.com/aio-libs/aiohttp / test_encoding_gzip

Function test_encoding_gzip

tests/test_client_functional.py:2422–2437  ·  view source on GitHub ↗
(aiohttp_client)

Source from the content-addressed store, hash-verified

2420
2421@pytest.mark.usefixtures("parametrize_zlib_backend")
2422async def test_encoding_gzip(aiohttp_client) -> None:
2423 async def handler(request):
2424 resp = web.Response(text="text")
2425 resp.enable_chunked_encoding()
2426 resp.enable_compression(web.ContentCoding.gzip)
2427 return resp
2428
2429 app = web.Application()
2430 app.router.add_get("/", handler)
2431 client = await aiohttp_client(app)
2432
2433 resp = await client.get("/")
2434 assert 200 == resp.status
2435 txt = await resp.text()
2436 assert txt == "text"
2437 resp.close()
2438
2439
2440@pytest.mark.usefixtures("parametrize_zlib_backend")

Callers

nothing calls this directly

Calls 5

textMethod · 0.95
aiohttp_clientFunction · 0.85
add_getMethod · 0.80
getMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…