MCPcopy
hub / github.com/encode/starlette / test_request_rcv

Function test_request_rcv

tests/test_requests.py:581–591  ·  view source on GitHub ↗
(messages: list[Message])

Source from the content-addressed store, hash-verified

579)
580@pytest.mark.anyio
581async def test_request_rcv(messages: list[Message]) -> None:
582 messages = messages.copy()
583
584 async def rcv() -> Message:
585 return {"type": "http.request", **messages.pop(0)}
586
587 request = Request({"type": "http"}, rcv)
588
589 body = await request.body()
590
591 assert body == b"123"
592
593
594@pytest.mark.anyio

Callers

nothing calls this directly

Calls 2

bodyMethod · 0.95
RequestClass · 0.90

Tested by

no test coverage detected