MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / test_bytes_data

Function test_bytes_data

tests/test_client_request.py:867–878  ·  view source on GitHub ↗
(loop, conn)

Source from the content-addressed store, hash-verified

865
866
867async def test_bytes_data(loop, conn) -> None:
868 for meth in ClientRequest.POST_METHODS:
869 req = ClientRequest(
870 meth, URL("http://python.org/"), data=b"binary data", loop=loop
871 )
872 resp = await req.send(conn)
873 assert "/" == req.url.path
874 assert isinstance(req.body, payload.BytesPayload)
875 assert b"binary data" == req.body._value
876 assert "application/octet-stream" == req.headers["CONTENT-TYPE"]
877 await req.close()
878 resp.close()
879
880
881@pytest.mark.usefixtures("parametrize_zlib_backend")

Callers

nothing calls this directly

Calls 4

sendMethod · 0.95
closeMethod · 0.95
ClientRequestClass · 0.90
closeMethod · 0.45

Tested by

no test coverage detected