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

Function test_write_payload_eof

tests/test_protocol.py:356–368  ·  view source on GitHub ↗
(transport)

Source from the content-addressed store, hash-verified

354
355
356def test_write_payload_eof(transport):
357 write = transport.write = mock.Mock()
358 msg = protocol.Response(transport, 200, http_version=(1, 0))
359 msg.send_headers()
360
361 msg.write(b'data1')
362 assert msg.headers_sent
363
364 msg.write(b'data2')
365 msg.write_eof()
366
367 content = b''.join([c[1][0] for c in list(write.mock_calls)])
368 assert b'data1data2' == content.split(b'\r\n\r\n', 1)[-1]
369
370
371def test_write_payload_chunked(transport):

Callers

nothing calls this directly

Calls 3

write_eofMethod · 0.95
send_headersMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected