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

Function test_populate_headers

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

Source from the content-addressed store, hash-verified

513
514
515def test_populate_headers(test_client_factory: TestClientFactory) -> None:
516 app = Response(content="hi", headers={}, media_type="text/html")
517 client = test_client_factory(app)
518 response = client.get("/")
519 assert response.text == "hi"
520 assert response.headers["content-length"] == "2"
521 assert response.headers["content-type"] == "text/html; charset=utf-8"
522
523
524def test_head_method(test_client_factory: TestClientFactory) -> None:

Callers

nothing calls this directly

Calls 3

ResponseClass · 0.90
test_client_factoryFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected