Home / Function/ test_post_invalid() — fastapi Function Reference

test_post_invalid() — fastapi Function Reference

Architecture documentation for the test_post_invalid() function in test_tutorial007.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  cc0c2f26_a909_b121_5611_131f47d849bd["test_post_invalid()"]
  00d502ac_f38a_b587_bfbc_e1f1c66b5b00["test_tutorial007.py"]
  cc0c2f26_a909_b121_5611_131f47d849bd -->|defined in| 00d502ac_f38a_b587_bfbc_e1f1c66b5b00
  style cc0c2f26_a909_b121_5611_131f47d849bd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py lines 52–73

def test_post_invalid(client: TestClient):
    yaml_data = """
        name: Deadpoolio
        tags:
        - x-force
        - x-men
        - x-avengers
        - sneaky: object
        """
    response = client.post("/items/", content=yaml_data)
    assert response.status_code == 422, response.text
    # insert_assert(response.json())
    assert response.json() == {
        "detail": [
            {
                "type": "string_type",
                "loc": ["tags", 3],
                "msg": "Input should be a valid string",
                "input": {"sneaky": "object"},
            }
        ]
    }

Domain

Subdomains

Frequently Asked Questions

What does test_post_invalid() do?
test_post_invalid() is a function in the fastapi codebase, defined in tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py.
Where is test_post_invalid() defined?
test_post_invalid() is defined in tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py at line 52.

Analyze Your Own Codebase

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

Try Supermodel Free