Home / Function/ test_post_body_valid() — fastapi Function Reference

test_post_body_valid() — fastapi Function Reference

Architecture documentation for the test_post_body_valid() function in test_tutorial003.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  148aec20_7756_8bb4_5e4d_88e5330031ae["test_post_body_valid()"]
  9b08de2c_95b2_2692_f47b_aee7a6cc9cc5["test_tutorial003.py"]
  148aec20_7756_8bb4_5e4d_88e5330031ae -->|defined in| 9b08de2c_95b2_2692_f47b_aee7a6cc9cc5
  style 148aec20_7756_8bb4_5e4d_88e5330031ae fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_body_multiple_params/test_tutorial003.py lines 26–46

def test_post_body_valid(client: TestClient):
    response = client.put(
        "/items/5",
        json={
            "importance": 2,
            "item": {"name": "Foo", "price": 50.5},
            "user": {"username": "Dave"},
        },
    )
    assert response.status_code == 200
    assert response.json() == {
        "item_id": 5,
        "importance": 2,
        "item": {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        },
        "user": {"username": "Dave", "full_name": None},
    }

Domain

Subdomains

Frequently Asked Questions

What does test_post_body_valid() do?
test_post_body_valid() is a function in the fastapi codebase, defined in tests/test_tutorial/test_body_multiple_params/test_tutorial003.py.
Where is test_post_body_valid() defined?
test_post_body_valid() is defined in tests/test_tutorial/test_body_multiple_params/test_tutorial003.py at line 26.

Analyze Your Own Codebase

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

Try Supermodel Free