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

Function app

tests/test_testclient.py:199–210  ·  tests/test_testclient.py::app
(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 class="st">"type": class="st">"http.response.start",
204 class="st">"status": 200,
205 class="st">"headers": [[bclass="st">"content-type", bclass="st">"text/plain"]],
206 }
207 )
208 await send({class="st">"type": class="st">"http.response.body", class="st">"body": bclass="st">"Hello, world!"})
209
210 return inner
211
212 client = test_client_factory(app) class="cm"># type: ignore
213 response = client.get(class="st">"/")

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