Home / Function/ test_post_items() — fastapi Function Reference

test_post_items() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  bece82a5_faf1_1ba8_1070_a71d8b7fc520["test_post_items()"]
  e2e636f3_7553_15fb_3b09_b56410b7ca46["test_tutorial003_tutorial004.py"]
  bece82a5_faf1_1ba8_1070_a71d8b7fc520 -->|defined in| e2e636f3_7553_15fb_3b09_b56410b7ca46
  style bece82a5_faf1_1ba8_1070_a71d8b7fc520 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py lines 44–62

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_tutorial003_tutorial004.py.
Where is test_post_items() defined?
test_post_items() is defined in tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py at line 44.

Analyze Your Own Codebase

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

Try Supermodel Free