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

Function test_write_payload_chunked

tests/test_protocol.py:371–382  ·  tests/test_protocol.py::test_write_payload_chunked
(transport)

Source from the content-addressed store, hash-verified

369
370
371def test_write_payload_chunked(transport):
372 write = transport.write = mock.Mock()
373
374 msg = protocol.Response(transport, 200)
375 msg.enable_chunked_encoding()
376 msg.send_headers()
377
378 msg.write(b&class="cm">#x27;data')
379 msg.write_eof()
380
381 content = b&class="cm">#x27;'.join([c[1][0] for c in list(write.mock_calls)])
382 assert b&class="cm">#x27;4\r\ndata\r\n0\r\n\r\nclass="st">' == content.split(b'\r\n\r\n', 1)[-1]
383
384
385def test_write_payload_chunked_multiple(transport):

Callers

nothing calls this directly

Calls 4

write_eofMethod · 0.95
send_headersMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected