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_tutorial001_tutorial002_tutorial003.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  a7ae7050_764c_160f_c1e8_940c1f4f2727["test_put_empty_body()"]
  4805b10c_df90_0eae_b943_1fe04ab3fbd7["test_tutorial001_tutorial002_tutorial003.py"]
  a7ae7050_764c_160f_c1e8_940c1f4f2727 -->|defined in| 4805b10c_df90_0eae_b943_1fe04ab3fbd7
  style a7ae7050_764c_160f_c1e8_940c1f4f2727 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_body_nested_models/test_tutorial001_tutorial002_tutorial003.py lines 87–108

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_tutorial001_tutorial002_tutorial003.py.
Where is test_put_empty_body() defined?
test_put_empty_body() is defined in tests/test_tutorial/test_body_nested_models/test_tutorial001_tutorial002_tutorial003.py at line 87.

Analyze Your Own Codebase

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

Try Supermodel Free