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

Function endpoint

tests/middleware/test_base.py:778–783  ·  view source on GitHub ↗
(scope: Scope, receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

776@pytest.mark.anyio
777async def test_read_request_stream_in_dispatch_wrapping_app_calls_body() -> None:
778 async def endpoint(scope: Scope, receive: Receive, send: Send) -> None:
779 request = Request(scope, receive)
780 async for chunk in request.stream(): # pragma: no branch
781 assert chunk == b"2"
782 break
783 await Response()(scope, receive, send)
784
785 class ConsumingMiddleware(BaseHTTPMiddleware):
786 async def dispatch(

Callers

nothing calls this directly

Calls 7

streamMethod · 0.95
bodyMethod · 0.95
RequestClass · 0.90
ResponseClass · 0.90
receiveFunction · 0.70
popMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected