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

Function app

tests/test_testclient.py:199–210  ·  view source on GitHub ↗
(scope: Scope)

Source from the content-addressed store, hash-verified

197
198def test_testclient_asgi2(test_client_factory: TestClientFactory) -> None:
199 def app(scope: Scope) -> ASGIInstance:
200 async def inner(receive: Receive, send: Send) -> None:
201 await send(
202 {
203 "type": "http.response.start",
204 "status": 200,
205 "headers": [[b"content-type", b"text/plain"]],
206 }
207 )
208 await send({"type": "http.response.body", "body": b"Hello, world!"})
209
210 return inner
211
212 client = test_client_factory(app) # type: ignore
213 response = client.get("/")

Callers

nothing calls this directly

Calls 9

set_cookieMethod · 0.95
acceptMethod · 0.95
send_bytesMethod · 0.95
JSONResponseClass · 0.90
ResponseClass · 0.90
RedirectResponseClass · 0.90
WebSocketClass · 0.90
sendFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected