Home / Function/ test_post_items() — fastapi Function Reference

test_post_items() — fastapi Function Reference

Architecture documentation for the test_post_items() function in test_tutorial002.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  5c368392_f08a_987f_5731_463e94488510["test_post_items()"]
  cfb597fb_64e0_0001_ac33_966e936568a1["test_tutorial002.py"]
  5c368392_f08a_987f_5731_463e94488510 -->|defined in| cfb597fb_64e0_0001_ac33_966e936568a1
  style 5c368392_f08a_987f_5731_463e94488510 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py lines 25–43

def test_post_items(client: TestClient):
    response = client.post(
        "/items/",
        json={
            "name": "Foo",
            "description": "Item description",
            "price": 42.0,
            "tax": 3.2,
            "tags": ["bar", "baz"],
        },
    )
    assert response.status_code == 200, response.text
    assert response.json() == {
        "name": "Foo",
        "description": "Item description",
        "price": 42.0,
        "tax": 3.2,
        "tags": IsList("bar", "baz", check_order=False),
    }

Domain

Subdomains

Frequently Asked Questions

What does test_post_items() do?
test_post_items() is a function in the fastapi codebase, defined in tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py.
Where is test_post_items() defined?
test_post_items() is defined in tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py at line 25.

Analyze Your Own Codebase

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

Try Supermodel Free