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

Function test_http_empty_data_text

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

Source from the content-addressed store, hash-verified

4479
4480
4481async def test_http_empty_data_text(aiohttp_client) -> None:
4482 async def handler(request):
4483 data = await request.read()
4484 ret = "ok" if data == b"" else "fail"
4485 resp = web.Response(text=ret)
4486 resp.headers["Content-Type"] = request.headers["Content-Type"]
4487 return resp
4488
4489 app = web.Application()
4490 app.add_routes([web.post("/", handler)])
4491
4492 client = await aiohttp_client(app)
4493
4494 async with await client.post("/", data="") as resp:
4495 assert resp.status == 200
4496 assert await resp.text() == "ok"
4497 assert resp.headers["Content-Type"] == "text/plain; charset=utf-8"
4498
4499
4500async def test_max_field_size_session_default(aiohttp_client: AiohttpClient) -> None:

Callers

nothing calls this directly

Calls 4

add_routesMethod · 0.95
textMethod · 0.95
aiohttp_clientFunction · 0.85
postMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…