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

Function test_prepare_length

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

Source from the content-addressed store, hash-verified

300
301
302def test_prepare_length(transport):
303 msg = protocol.Response(transport, 200)
304 w_l_p = msg._write_length_payload = mock.Mock()
305 w_l_p.return_value = iter([1, 2, 3])
306
307 msg.add_headers(('content-length', '42'))
308 msg.send_headers()
309
310 assert w_l_p.called
311 assert (42,) == w_l_p.call_args[0]
312
313
314def test_prepare_chunked_force(transport):

Callers

nothing calls this directly

Calls 2

add_headersMethod · 0.80
send_headersMethod · 0.80

Tested by

no test coverage detected