Home / Function/ test_put_invalid_importance() — fastapi Function Reference

test_put_invalid_importance() — fastapi Function Reference

Architecture documentation for the test_put_invalid_importance() function in test_tutorial004.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  e4b4fd97_598c_b027_6a2e_31944c3a37f5["test_put_invalid_importance()"]
  b873bd55_00fd_d2fe_6e07_5c06e67da7d3["test_tutorial004.py"]
  e4b4fd97_598c_b027_6a2e_31944c3a37f5 -->|defined in| b873bd55_00fd_d2fe_6e07_5c06e67da7d3
  style e4b4fd97_598c_b027_6a2e_31944c3a37f5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_body_multiple_params/test_tutorial004.py lines 137–157

def test_put_invalid_importance(client: TestClient):
    response = client.put(
        "/items/5",
        json={
            "importance": 0,
            "item": {"name": "Foo", "price": 50.5},
            "user": {"username": "Dave"},
        },
    )
    assert response.status_code == 422
    assert response.json() == {
        "detail": [
            {
                "loc": ["body", "importance"],
                "msg": "Input should be greater than 0",
                "type": "greater_than",
                "input": 0,
                "ctx": {"gt": 0},
            },
        ],
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free