Coverage for tests / test_tutorial / test_response_headers / test_tutorial002.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.3, created at 2026-02-12 18:15 +0000

1from fastapi.testclient import TestClient 1abcd

2 

3from docs_src.response_headers.tutorial002_py310 import app 1abcd

4 

5client = TestClient(app) 1abcd

6 

7 

8def test_path_operation(): 1abcd

9 response = client.get("/headers-and-object/") 1efg

10 assert response.status_code == 200, response.text 1efg

11 assert response.json() == {"message": "Hello World"} 1efg

12 assert response.headers["X-Cat-Dog"] == "alone in the world" 1efg