test_invalid_price() — fastapi Function Reference
Architecture documentation for the test_invalid_price() function in test_tutorial001.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 1716894d_2f99_fc83_5243_5009c827233a["test_invalid_price()"] 4635dc70_c39c_9acd_d962_f94f64b32b98["test_tutorial001.py"] 1716894d_2f99_fc83_5243_5009c827233a -->|defined in| 4635dc70_c39c_9acd_d962_f94f64b32b98 style 1716894d_2f99_fc83_5243_5009c827233a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_tutorial/test_body_fields/test_tutorial001.py lines 59–72
def test_invalid_price(client: TestClient):
response = client.put("/items/5", json={"item": {"name": "Foo", "price": -3.0}})
assert response.status_code == 422
assert response.json() == {
"detail": [
{
"type": "greater_than",
"loc": ["body", "item", "price"],
"msg": "Input should be greater than 0",
"input": -3.0,
"ctx": {"gt": 0.0},
}
]
}
Domain
Subdomains
Source
Frequently Asked Questions
What does test_invalid_price() do?
test_invalid_price() is a function in the fastapi codebase, defined in tests/test_tutorial/test_body_fields/test_tutorial001.py.
Where is test_invalid_price() defined?
test_invalid_price() is defined in tests/test_tutorial/test_body_fields/test_tutorial001.py at line 59.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free