Home / Function/ test_multiple_path() — fastapi Function Reference

test_multiple_path() — fastapi Function Reference

Architecture documentation for the test_multiple_path() function in test_annotated.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  280aa091_311d_e10e_4fe0_bf2692811e4e["test_multiple_path()"]
  ebdf85eb_0692_0882_dd01_47bca11b24da["test_annotated.py"]
  280aa091_311d_e10e_4fe0_bf2692811e4e -->|defined in| ebdf85eb_0692_0882_dd01_47bca11b24da
  style 280aa091_311d_e10e_4fe0_bf2692811e4e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_annotated.py lines 77–100

def test_multiple_path():
    app = FastAPI()

    @app.get("/test1")
    @app.get("/test2")
    async def test(var: Annotated[str, Query()] = "bar"):
        return {"foo": var}

    client = TestClient(app)
    response = client.get("/test1")
    assert response.status_code == 200
    assert response.json() == {"foo": "bar"}

    response = client.get("/test1", params={"var": "baz"})
    assert response.status_code == 200
    assert response.json() == {"foo": "baz"}

    response = client.get("/test2")
    assert response.status_code == 200
    assert response.json() == {"foo": "bar"}

    response = client.get("/test2", params={"var": "baz"})
    assert response.status_code == 200
    assert response.json() == {"foo": "baz"}

Domain

Subdomains

Frequently Asked Questions

What does test_multiple_path() do?
test_multiple_path() is a function in the fastapi codebase, defined in tests/test_annotated.py.
Where is test_multiple_path() defined?
test_multiple_path() is defined in tests/test_annotated.py at line 77.

Analyze Your Own Codebase

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

Try Supermodel Free