test_router_prefix_with_template.py — fastapi Source File
Architecture documentation for test_router_prefix_with_template.py, a python file in the fastapi codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 0ba63d2c_6e58_00c3_ce18_db2ceb9ad6ae["test_router_prefix_with_template.py"] 534f6e44_61b8_3c38_8b89_6934a6df9802["__init__.py"] 0ba63d2c_6e58_00c3_ce18_db2ceb9ad6ae --> 534f6e44_61b8_3c38_8b89_6934a6df9802 a7c04dee_ee23_5891_b185_47ff6bed036d["testclient.py"] 0ba63d2c_6e58_00c3_ce18_db2ceb9ad6ae --> a7c04dee_ee23_5891_b185_47ff6bed036d style 0ba63d2c_6e58_00c3_ce18_db2ceb9ad6ae fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
from fastapi import APIRouter, FastAPI
from fastapi.testclient import TestClient
app = FastAPI()
router = APIRouter()
@router.get("/users/{id}")
def read_user(segment: str, id: str):
return {"segment": segment, "id": id}
app.include_router(router, prefix="/{segment}")
client = TestClient(app)
def test_get():
response = client.get("/seg/users/foo")
assert response.status_code == 200, response.text
assert response.json() == {"segment": "seg", "id": "foo"}
Domain
Subdomains
Functions
Dependencies
Source
Frequently Asked Questions
What does test_router_prefix_with_template.py do?
test_router_prefix_with_template.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Routing subdomain.
What functions are defined in test_router_prefix_with_template.py?
test_router_prefix_with_template.py defines 2 function(s): read_user, test_get.
What does test_router_prefix_with_template.py depend on?
test_router_prefix_with_template.py imports 2 module(s): __init__.py, testclient.py.
Where is test_router_prefix_with_template.py in the architecture?
test_router_prefix_with_template.py is located at tests/test_router_prefix_with_template.py (domain: FastAPI, subdomain: Routing, directory: tests).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free