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

Function test_head_request

tests/protocols/test_http.py:361–368  ·  view source on GitHub ↗
(http_protocol_cls: type[HTTPProtocol])

Source from the content-addressed store, hash-verified

359
360
361async def test_head_request(http_protocol_cls: type[HTTPProtocol]):
362 app = Response("Hello, world", media_type="text/plain")
363
364 protocol = get_connected_protocol(app, http_protocol_cls)
365 protocol.data_received(SIMPLE_HEAD_REQUEST)
366 await protocol.loop.run_one()
367 assert b"HTTP/1.1 200 OK" in protocol.transport.buffer
368 assert b"Hello, world" not in protocol.transport.buffer
369
370
371async def test_post_request(http_protocol_cls: type[HTTPProtocol]):

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected