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

Function test_get_request

tests/protocols/test_http.py:280–287  ·  tests/protocols/test_http.py::test_get_request
(http_protocol_cls: type[HTTPProtocol])

Source from the content-addressed store, hash-verified

278
279
280async def test_get_request(http_protocol_cls: type[HTTPProtocol]):
281 app = Response(class="st">"Hello, world", media_type=class="st">"text/plain")
282
283 protocol = get_connected_protocol(app, http_protocol_cls)
284 protocol.data_received(SIMPLE_GET_REQUEST)
285 await protocol.loop.run_one()
286 assert bclass="st">"HTTP/1.1 200 OK" in protocol.transport.buffer
287 assert bclass="st">"Hello, world" in protocol.transport.buffer
288
289
290@pytest.mark.parametrize(

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