Home / Function/ test_put() — fastapi Function Reference

test_put() — fastapi Function Reference

Architecture documentation for the test_put() function in test_tutorial001.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  502122d0_1287_6e0a_d6dd_47fc2e03e5ed["test_put()"]
  9ee9373a_b923_622d_7596_fd0836d411d9["test_tutorial001.py"]
  502122d0_1287_6e0a_d6dd_47fc2e03e5ed -->|defined in| 9ee9373a_b923_622d_7596_fd0836d411d9
  style 502122d0_1287_6e0a_d6dd_47fc2e03e5ed fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_encoder/test_tutorial001.py lines 29–46

def test_put(client: TestClient, mod: ModuleType):
    fake_db = mod.fake_db

    response = client.put(
        "/items/123",
        json={
            "title": "Foo",
            "timestamp": "2023-01-01T12:00:00",
            "description": "An optional description",
        },
    )
    assert response.status_code == 200
    assert "123" in fake_db
    assert fake_db["123"] == {
        "title": "Foo",
        "timestamp": "2023-01-01T12:00:00",
        "description": "An optional description",
    }

Domain

Subdomains

Frequently Asked Questions

What does test_put() do?
test_put() is a function in the fastapi codebase, defined in tests/test_tutorial/test_encoder/test_tutorial001.py.
Where is test_put() defined?
test_put() is defined in tests/test_tutorial/test_encoder/test_tutorial001.py at line 29.

Analyze Your Own Codebase

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

Try Supermodel Free