MCPcopy Create free account
hub / github.com/encode/starlette / test_streaming_response_known_size

Function test_streaming_response_known_size

tests/test_responses.py:601–605  ·  view source on GitHub ↗
(test_client_factory: TestClientFactory)

Source from the content-addressed store, hash-verified

599
600
601def test_streaming_response_known_size(test_client_factory: TestClientFactory) -> None:
602 app = StreamingResponse(content=iter(["hello", "world"]), headers={"content-length": "10"})
603 client: TestClient = test_client_factory(app)
604 response = client.get("/")
605 assert response.headers["content-length"] == "10"
606
607
608def test_response_memoryview(test_client_factory: TestClientFactory) -> None:

Callers

nothing calls this directly

Calls 3

StreamingResponseClass · 0.90
test_client_factoryFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected