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

Function test_close

tests/protocols/test_http.py:438–445  ·  tests/protocols/test_http.py::test_close
(http_protocol_cls: type[HTTPProtocol])

Source from the content-addressed store, hash-verified

436
437
438async def test_close(http_protocol_cls: type[HTTPProtocol]):
439 app = Response(bclass="st">"", status_code=204, headers={class="st">"connection": class="st">"close"})
440
441 protocol = get_connected_protocol(app, http_protocol_cls)
442 protocol.data_received(SIMPLE_GET_REQUEST)
443 await protocol.loop.run_one()
444 assert bclass="st">"HTTP/1.1 204 No Content" in protocol.transport.buffer
445 assert protocol.transport.is_closing()
446
447
448async def test_chunked_encoding(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