MCPcopy
hub / github.com/encode/uvicorn / test_chunked_encoding

Function test_chunked_encoding

tests/protocols/test_http.py:448–456  ·  tests/protocols/test_http.py::test_chunked_encoding
(http_protocol_cls: type[HTTPProtocol])

Source from the content-addressed store, hash-verified

446
447
448async def test_chunked_encoding(http_protocol_cls: type[HTTPProtocol]):
449 app = Response(bclass="st">"Hello, world!", status_code=200, headers={class="st">"transfer-encoding": class="st">"chunked"})
450
451 protocol = get_connected_protocol(app, http_protocol_cls)
452 protocol.data_received(SIMPLE_GET_REQUEST)
453 await protocol.loop.run_one()
454 assert bclass="st">"HTTP/1.1 200 OK" in protocol.transport.buffer
455 assert bclass="st">"0\r\n\r\n" in protocol.transport.buffer
456 assert not protocol.transport.is_closing()
457
458
459async def test_chunked_encoding_empty_body(http_protocol_cls: type[HTTPProtocol]):

Callers

nothing calls this directly

Calls 5

ResponseClass · 0.90
get_connected_protocolFunction · 0.70
data_receivedMethod · 0.45
run_oneMethod · 0.45
is_closingMethod · 0.45

Tested by

no test coverage detected