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

Function test_file_response_range_multi_head

tests/test_responses.py:765–782  ·  view source on GitHub ↗
(file_response_client: TestClient)

Source from the content-addressed store, hash-verified

763
764
765def test_file_response_range_multi_head(file_response_client: TestClient) -> None:
766 response = file_response_client.head("/", headers={"Range": "bytes=0-100, 200-300"})
767 assert response.status_code == 206
768 assert "content-range" not in response.headers
769 assert response.headers["content-length"] == "448"
770 assert response.headers["content-type"].startswith("multipart/byteranges; boundary=")
771 assert response.content == b""
772
773 response = file_response_client.head(
774 "/",
775 headers={"Range": "bytes=200-300", "if-range": response.headers["etag"][:-1]},
776 )
777 assert response.status_code == 200
778 response = file_response_client.head(
779 "/",
780 headers={"Range": "bytes=200-300", "if-range": response.headers["etag"]},
781 )
782 assert response.status_code == 206
783
784
785def test_file_response_range_invalid(file_response_client: TestClient) -> None:

Callers

nothing calls this directly

Calls 1

headMethod · 0.80

Tested by

no test coverage detected