test_get_invalid_item() — fastapi Function Reference
Architecture documentation for the test_get_invalid_item() function in test_tutorial015.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 10234cc2_d64c_856b_324e_137afede1aaa["test_get_invalid_item()"] 4d63ef91_9f28_3ba0_a0b3_78a5cf06a3c0["test_tutorial015.py"] 10234cc2_d64c_856b_324e_137afede1aaa -->|defined in| 4d63ef91_9f28_3ba0_a0b3_78a5cf06a3c0 style 10234cc2_d64c_856b_324e_137afede1aaa fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_tutorial/test_query_params_str_validations/test_tutorial015.py lines 48–63
def test_get_invalid_item(client: TestClient):
response = client.get("/items?id=wtf-yes")
assert response.status_code == 422, response.text
assert response.json() == snapshot(
{
"detail": [
{
"type": "value_error",
"loc": ["query", "id"],
"msg": 'Value error, Invalid ID format, it must start with "isbn-" or "imdb-"',
"input": "wtf-yes",
"ctx": {"error": {}},
}
]
}
)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_get_invalid_item() do?
test_get_invalid_item() is a function in the fastapi codebase, defined in tests/test_tutorial/test_query_params_str_validations/test_tutorial015.py.
Where is test_get_invalid_item() defined?
test_get_invalid_item() is defined in tests/test_tutorial/test_query_params_str_validations/test_tutorial015.py at line 48.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free