Coverage for tests/test_tutorial/test_response_headers/test_tutorial001.py: 100%
9 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-05-05 00:03 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-05-05 00:03 +0000
1from fastapi.testclient import TestClient 1ghijkl
3from docs_src.response_headers.tutorial001 import app 1ghijkl
5client = TestClient(app) 1ghijkl
8def test_path_operation(): 1ghijkl
9 response = client.get("/headers/") 1abcdef
10 assert response.status_code == 200, response.text 1abcdef
11 assert response.json() == {"message": "Hello World"} 1abcdef
12 assert response.headers["X-Cat-Dog"] == "alone in the world" 1abcdef
13 assert response.headers["Content-Language"] == "en-US" 1abcdef