Home / Function/ test_put_empty_body() — fastapi Function Reference

test_put_empty_body() — fastapi Function Reference

Architecture documentation for the test_put_empty_body() function in test_tutorial005.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  63c9f012_15f3_83e1_446e_01495b81838c["test_put_empty_body()"]
  72145184_2a0f_72ca_76c5_e4190504531a["test_tutorial005.py"]
  63c9f012_15f3_83e1_446e_01495b81838c -->|defined in| 72145184_2a0f_72ca_76c5_e4190504531a
  style 63c9f012_15f3_83e1_446e_01495b81838c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_body_nested_models/test_tutorial005.py lines 70–91

def test_put_empty_body(client: TestClient):
    response = client.put(
        "/items/5",
        json={},
    )
    assert response.status_code == 422, response.text
    assert response.json() == {
        "detail": [
            {
                "loc": ["body", "name"],
                "input": {},
                "msg": "Field required",
                "type": "missing",
            },
            {
                "loc": ["body", "price"],
                "input": {},
                "msg": "Field required",
                "type": "missing",
            },
        ]
    }

Domain

Subdomains

Frequently Asked Questions

What does test_put_empty_body() do?
test_put_empty_body() is a function in the fastapi codebase, defined in tests/test_tutorial/test_body_nested_models/test_tutorial005.py.
Where is test_put_empty_body() defined?
test_put_empty_body() is defined in tests/test_tutorial/test_body_nested_models/test_tutorial005.py at line 70.

Analyze Your Own Codebase

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

Try Supermodel Free