Home / Function/ test_header_param_model_invalid() — fastapi Function Reference

test_header_param_model_invalid() — fastapi Function Reference

Architecture documentation for the test_header_param_model_invalid() function in test_tutorial001.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  d5055926_100b_11b7_95d4_6d0110d68833["test_header_param_model_invalid()"]
  b84aa210_e69e_29d8_ee3c_078b17ed41e5["test_tutorial001.py"]
  d5055926_100b_11b7_95d4_6d0110d68833 -->|defined in| b84aa210_e69e_29d8_ee3c_078b17ed41e5
  style d5055926_100b_11b7_95d4_6d0110d68833 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_header_param_models/test_tutorial001.py lines 59–80

def test_header_param_model_invalid(client: TestClient):
    response = client.get("/items/")
    assert response.status_code == 422
    assert response.json() == snapshot(
        {
            "detail": [
                {
                    "type": "missing",
                    "loc": ["header", "save_data"],
                    "msg": "Field required",
                    "input": {
                        "x_tag": [],
                        "host": "testserver",
                        "accept": "*/*",
                        "accept-encoding": "gzip, deflate",
                        "connection": "keep-alive",
                        "user-agent": "testclient",
                    },
                }
            ]
        }
    )

Domain

Subdomains

Frequently Asked Questions

What does test_header_param_model_invalid() do?
test_header_param_model_invalid() is a function in the fastapi codebase, defined in tests/test_tutorial/test_header_param_models/test_tutorial001.py.
Where is test_header_param_model_invalid() defined?
test_header_param_model_invalid() is defined in tests/test_tutorial/test_header_param_models/test_tutorial001.py at line 59.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free