mirror of https://github.com/tiangolo/fastapi.git
Add args/kwargs to rest of the methods and fix test
This commit is contained in:
parent
0022fc77c0
commit
d5548ac802
|
|
@ -2226,7 +2226,6 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -2545,6 +2544,8 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP POST operation.
|
Add a *path operation* using an HTTP POST operation.
|
||||||
|
|
@ -2590,6 +2591,8 @@ class FastAPI(Starlette):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
def delete(
|
def delete(
|
||||||
|
|
@ -2604,7 +2607,6 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -2923,6 +2925,8 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP DELETE operation.
|
Add a *path operation* using an HTTP DELETE operation.
|
||||||
|
|
@ -2963,6 +2967,8 @@ class FastAPI(Starlette):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
def options(
|
def options(
|
||||||
|
|
@ -2977,7 +2983,6 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -3296,6 +3301,8 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP OPTIONS operation.
|
Add a *path operation* using an HTTP OPTIONS operation.
|
||||||
|
|
@ -3336,6 +3343,8 @@ class FastAPI(Starlette):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
def head(
|
def head(
|
||||||
|
|
@ -3350,7 +3359,6 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -3669,6 +3677,8 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP HEAD operation.
|
Add a *path operation* using an HTTP HEAD operation.
|
||||||
|
|
@ -3709,6 +3719,8 @@ class FastAPI(Starlette):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
def patch(
|
def patch(
|
||||||
|
|
@ -3723,7 +3735,6 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -4042,6 +4053,8 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP PATCH operation.
|
Add a *path operation* using an HTTP PATCH operation.
|
||||||
|
|
@ -4087,6 +4100,8 @@ class FastAPI(Starlette):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
def trace(
|
def trace(
|
||||||
|
|
@ -4101,7 +4116,6 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -4420,6 +4434,8 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP TRACE operation.
|
Add a *path operation* using an HTTP TRACE operation.
|
||||||
|
|
@ -4460,6 +4476,8 @@ class FastAPI(Starlette):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
def websocket_route(
|
def websocket_route(
|
||||||
|
|
|
||||||
|
|
@ -984,6 +984,8 @@ class APIRouter(routing.Router):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
return func
|
return func
|
||||||
|
|
||||||
|
|
@ -1089,7 +1091,6 @@ class APIRouter(routing.Router):
|
||||||
def include_router(
|
def include_router(
|
||||||
self,
|
self,
|
||||||
router: Annotated["APIRouter", Doc("The `APIRouter` to include.")],
|
router: Annotated["APIRouter", Doc("The `APIRouter` to include.")],
|
||||||
*,
|
|
||||||
prefix: Annotated[str, Doc("An optional path prefix for the router.")] = "",
|
prefix: Annotated[str, Doc("An optional path prefix for the router.")] = "",
|
||||||
tags: Annotated[
|
tags: Annotated[
|
||||||
Optional[List[Union[str, Enum]]],
|
Optional[List[Union[str, Enum]]],
|
||||||
|
|
@ -1197,6 +1198,8 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Include another `APIRouter` in the same current `APIRouter`.
|
Include another `APIRouter` in the same current `APIRouter`.
|
||||||
|
|
@ -1295,6 +1298,8 @@ class APIRouter(routing.Router):
|
||||||
callbacks=current_callbacks,
|
callbacks=current_callbacks,
|
||||||
openapi_extra=route.openapi_extra,
|
openapi_extra=route.openapi_extra,
|
||||||
generate_unique_id_function=current_generate_unique_id,
|
generate_unique_id_function=current_generate_unique_id,
|
||||||
|
*args,
|
||||||
|
**kwargs
|
||||||
)
|
)
|
||||||
elif isinstance(route, routing.Route):
|
elif isinstance(route, routing.Route):
|
||||||
methods = list(route.methods or [])
|
methods = list(route.methods or [])
|
||||||
|
|
@ -1702,6 +1707,8 @@ class APIRouter(routing.Router):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
def put(
|
def put(
|
||||||
|
|
@ -1716,7 +1723,6 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -2035,6 +2041,8 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any,
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP PUT operation.
|
Add a *path operation* using an HTTP PUT operation.
|
||||||
|
|
@ -2084,6 +2092,8 @@ class APIRouter(routing.Router):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
def post(
|
def post(
|
||||||
|
|
@ -2098,7 +2108,6 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -2417,6 +2426,8 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any,
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP POST operation.
|
Add a *path operation* using an HTTP POST operation.
|
||||||
|
|
@ -2466,6 +2477,8 @@ class APIRouter(routing.Router):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
def delete(
|
def delete(
|
||||||
|
|
@ -2480,7 +2493,6 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -2799,6 +2811,8 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any,
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP DELETE operation.
|
Add a *path operation* using an HTTP DELETE operation.
|
||||||
|
|
@ -2843,6 +2857,8 @@ class APIRouter(routing.Router):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
def options(
|
def options(
|
||||||
|
|
@ -2857,7 +2873,6 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -3176,6 +3191,8 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any,
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP OPTIONS operation.
|
Add a *path operation* using an HTTP OPTIONS operation.
|
||||||
|
|
@ -3220,6 +3237,8 @@ class APIRouter(routing.Router):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
def head(
|
def head(
|
||||||
|
|
@ -3234,7 +3253,6 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -3553,6 +3571,8 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any,
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP HEAD operation.
|
Add a *path operation* using an HTTP HEAD operation.
|
||||||
|
|
@ -3602,6 +3622,8 @@ class APIRouter(routing.Router):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
def patch(
|
def patch(
|
||||||
|
|
@ -3616,7 +3638,6 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -3935,6 +3956,8 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any,
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP PATCH operation.
|
Add a *path operation* using an HTTP PATCH operation.
|
||||||
|
|
@ -3984,6 +4007,8 @@ class APIRouter(routing.Router):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
def trace(
|
def trace(
|
||||||
|
|
@ -3998,7 +4023,6 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
*,
|
|
||||||
response_model: Annotated[
|
response_model: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -4317,6 +4341,8 @@ class APIRouter(routing.Router):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = Default(generate_unique_id),
|
] = Default(generate_unique_id),
|
||||||
|
*args: Any,
|
||||||
|
**kwargs: Any,
|
||||||
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
) -> Callable[[DecoratedCallable], DecoratedCallable]:
|
||||||
"""
|
"""
|
||||||
Add a *path operation* using an HTTP TRACE operation.
|
Add a *path operation* using an HTTP TRACE operation.
|
||||||
|
|
@ -4366,6 +4392,8 @@ class APIRouter(routing.Router):
|
||||||
callbacks=callbacks,
|
callbacks=callbacks,
|
||||||
openapi_extra=openapi_extra,
|
openapi_extra=openapi_extra,
|
||||||
generate_unique_id_function=generate_unique_id_function,
|
generate_unique_id_function=generate_unique_id_function,
|
||||||
|
*args,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
@deprecated(
|
@deprecated(
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,24 @@
|
||||||
import inspect
|
import inspect
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from fastapi import APIRouter, FastAPI
|
from fastapi import APIRouter, FastAPI
|
||||||
|
|
||||||
method_names = ["get", "put", "post", "delete", "options", "head", "patch", "trace"]
|
method_names = ["get", "put", "post", "delete", "options", "head", "patch", "trace"]
|
||||||
|
|
||||||
|
|
||||||
def test_signatures_consistency():
|
@pytest.mark.parametrize('method_name', ["get", "put", "post", "delete", "options", "head", "patch", "trace"])
|
||||||
base_sig = inspect.signature(APIRouter.get)
|
@pytest.mark.parametrize('sig_param', inspect.signature(APIRouter.get).parameters.items())
|
||||||
for method_name in method_names:
|
def test_signatures_consistency(method_name, sig_param):
|
||||||
router_method = getattr(APIRouter, method_name)
|
router_method = getattr(APIRouter, method_name)
|
||||||
app_method = getattr(FastAPI, method_name)
|
app_method = getattr(FastAPI, method_name)
|
||||||
router_sig = inspect.signature(router_method)
|
router_sig = inspect.signature(router_method)
|
||||||
app_sig = inspect.signature(app_method)
|
app_sig = inspect.signature(app_method)
|
||||||
param: inspect.Parameter
|
param: inspect.Parameter
|
||||||
for key, param in base_sig.parameters.items():
|
key, param = sig_param
|
||||||
router_param: inspect.Parameter = router_sig.parameters[key]
|
router_param: inspect.Parameter = router_sig.parameters[key]
|
||||||
app_param: inspect.Parameter = app_sig.parameters[key]
|
app_param: inspect.Parameter = app_sig.parameters[key]
|
||||||
assert param.annotation == router_param.annotation
|
assert param.annotation == router_param.annotation
|
||||||
assert param.annotation == app_param.annotation
|
assert param.annotation == app_param.annotation
|
||||||
assert param.default == router_param.default
|
assert param.default == router_param.default
|
||||||
assert param.default == app_param.default
|
assert param.default == app_param.default
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue