Coverage for tests/test_tutorial/test_response_headers/test_tutorial002.py: 100%
8 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
1from fastapi.testclient import TestClient 1abcde
3from docs_src.response_headers.tutorial002 import app 1abcde
5client = TestClient(app) 1abcde
8def test_path_operation(): 1abcde
9 response = client.get("/headers-and-object/") 1abcde
10 assert response.status_code == 200, response.text 1abcde
11 assert response.json() == {"message": "Hello World"} 1abcde
12 assert response.headers["X-Cat-Dog"] == "alone in the world" 1abcde