test_operations_signatures.py — fastapi Source File
Architecture documentation for test_operations_signatures.py, a python file in the fastapi codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 061b758f_afcc_18c0_6d74_c11f748a0d30["test_operations_signatures.py"] d01056e9_3915_bd46_d8dd_a25ff9c1e35c["inspect"] 061b758f_afcc_18c0_6d74_c11f748a0d30 --> d01056e9_3915_bd46_d8dd_a25ff9c1e35c 534f6e44_61b8_3c38_8b89_6934a6df9802["__init__.py"] 061b758f_afcc_18c0_6d74_c11f748a0d30 --> 534f6e44_61b8_3c38_8b89_6934a6df9802 style 061b758f_afcc_18c0_6d74_c11f748a0d30 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import inspect
from fastapi import APIRouter, FastAPI
method_names = ["get", "put", "post", "delete", "options", "head", "patch", "trace"]
def test_signatures_consistency():
base_sig = inspect.signature(APIRouter.get)
for method_name in method_names:
router_method = getattr(APIRouter, method_name)
app_method = getattr(FastAPI, method_name)
router_sig = inspect.signature(router_method)
app_sig = inspect.signature(app_method)
param: inspect.Parameter
for key, param in base_sig.parameters.items():
router_param: inspect.Parameter = router_sig.parameters[key]
app_param: inspect.Parameter = app_sig.parameters[key]
assert param.annotation == router_param.annotation
assert param.annotation == app_param.annotation
assert param.default == router_param.default
assert param.default == app_param.default
Domain
Subdomains
Functions
Dependencies
- __init__.py
- inspect
Source
Frequently Asked Questions
What does test_operations_signatures.py do?
test_operations_signatures.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Applications subdomain.
What functions are defined in test_operations_signatures.py?
test_operations_signatures.py defines 1 function(s): test_signatures_consistency.
What does test_operations_signatures.py depend on?
test_operations_signatures.py imports 2 module(s): __init__.py, inspect.
Where is test_operations_signatures.py in the architecture?
test_operations_signatures.py is located at tests/test_operations_signatures.py (domain: FastAPI, subdomain: Applications, directory: tests).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free