Debian Codegraph @

tests/test_tutorial/test_response_headers/test_tutorial002.py

raw
1 from fastapi.testclient import TestClient
2
3 from docs_src.response_headers.tutorial002_py310 import app
4
5 client = TestClient(app)
6
7
8 def test_path_operation():
9 response = client.get("/headers-and-object/")
10 assert response.status_code == 200, response.text
11 assert response.json() == {"message": "Hello World"}
12 assert response.headers["X-Cat-Dog"] == "alone in the world"