(message: Message)
| 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. |
no test coverage detected