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

Function send

tests/test_responses.py:263–274  ·  tests/test_responses.py::send
(message: Message)

Source from the content-addressed store, hash-verified

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