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

Function send

tests/test_responses.py:263–274  ·  view source on GitHub ↗
(message: Message)

Source from the content-addressed store, hash-verified

261 ... # pragma: no cover
262
263 async def send(message: Message) -> None:
264 if message["type"] == "http.response.start":
265 assert message["status"] == status.HTTP_200_OK
266 headers = Headers(raw=message["headers"])
267 assert headers["content-type"] == "image/png"
268 assert "content-length" in headers
269 assert "content-disposition" in headers
270 assert "last-modified" in headers
271 assert "etag" in headers
272 elif message["type"] == "http.response.body": # pragma: no branch
273 assert message["body"] == b""
274 assert message["more_body"] is False
275
276 # Since the TestClient drops the response body on HEAD requests, we need to test
277 # this directly.

Callers 15

innerFunction · 0.70
appFunction · 0.70
_sendFunction · 0.70
modified_sendMethod · 0.70
modified_sendMethod · 0.70
modified_sendMethod · 0.70
pure_asgi_echo_pathsFunction · 0.70
senderFunction · 0.50
__call__Method · 0.50
wrappedMethod · 0.50
__call__Method · 0.50
stream_responseMethod · 0.50

Calls 4

HeadersClass · 0.90
getMethod · 0.45
appendMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected