fastapi/tests
Sebastián Ramírez 313bbe802f
Add support for shared/top-level parameters (dependencies, tags, etc) (#2434)
*  Add Default and DefaultPlaceholder data structures

to handle defaults and overrides

*  Add utils to get values by priority handling DefaultPlaceholders

*  Add support for top-level parameters in FastAPI, APIRouter, include_router

including: prefix, tags, dependencies, deprecated, include_in_schema, responses, default_response_class, callbacks

* ♻️ Update openapi utils to handle DefaultPlaceholder for response_class

* 📝 Update bigger-application example code to use top-level params

and showcase them in APIRouter, FastAPI, include_router

* 📝 Update docs for Bigger Applications, include diagrams, top-level params

* 🔥 Simplify code and docs for callbacks as default_response_class is no longer required

* 📝 Add docs for top-level dependencies, in FastAPI()

* 📝 Add docs reference to top-level dependencies in docs for decorator

*  Update/increase tests for Bigger Applications including shared parameters

*  Add tests for top-level dependencies in FastAPI()

*  Add tests for internal DefaultPlaceholder

*  Update/increase tests for callbacks with top-level parameters

*  Add LOTS of tests covering branches and cases for shared parameters

in top-level FastAPI, path operations, include_router, APIRouter, its path operations, nested include_router, nested APIRouter, and its path operations

* 🎨 Format/reorder parameters for consistency in FastAPI, APIRouter, include_router
2020-11-29 18:32:18 +01:00
..
test_modules_same_name_body Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_tutorial Add support for shared/top-level parameters (dependencies, tags, etc) (#2434) 2020-11-29 18:32:18 +01:00
__init__.py Add first tests, for path and query 2018-12-08 11:56:07 +04:00
main.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_additional_properties.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_additional_response_extra.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_additional_responses_bad.py Re-export utils from Starlette (#1064) 2020-03-01 21:49:20 +01:00
test_additional_responses_custom_model_in_callback.py 🐛 Fix OpenAPI generation when using callbacks with routers including Pydantic models (#1322) 2020-06-12 22:35:59 +02:00
test_additional_responses_custom_validationerror.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_additional_responses_default_validationerror.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_additional_responses_response_class.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_additional_responses_router.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_application.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_callable_endpoint.py 📝 Use Optional in docs (#1644) 2020-06-28 20:13:30 +02:00
test_custom_route_class.py Re-export utils from Starlette (#1064) 2020-03-01 21:49:20 +01:00
test_custom_swagger_ui_redirect.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_datastructures.py Add support for shared/top-level parameters (dependencies, tags, etc) (#2434) 2020-11-29 18:32:18 +01:00
test_datetime_custom_encoder.py Re-export utils from Starlette (#1064) 2020-03-01 21:49:20 +01:00
test_default_response_class.py Re-export utils from Starlette (#1064) 2020-03-01 21:49:20 +01:00
test_default_response_class_router.py Re-export utils from Starlette (#1064) 2020-03-01 21:49:20 +01:00
test_dependency_cache.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_dependency_class.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_dependency_contextmanager.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_dependency_duplicates.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_dependency_overrides.py 📝 Use Optional in docs (#1644) 2020-06-28 20:13:30 +02:00
test_dependency_security_overrides.py 🐛 Fix testing security scopes when using dependency overrides (#1549) 2020-06-14 17:54:46 +02:00
test_deprecated_openapi_prefix.py Auto-generate OpenAPI servers from root_path (#1596) 2020-07-10 19:28:18 +02:00
test_duplicate_models_openapi.py Update response_model_by_alias (#1642) 2020-06-28 13:58:21 +02:00
test_empty_router.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_exception_handlers.py 🐛 Fix bug overriding custom HTTPException and RequestValidationError from exception_handlers (#1924) 2020-11-05 22:21:40 +01:00
test_extra_routes.py 📝 Use Optional in docs (#1644) 2020-06-28 20:13:30 +02:00
test_fakeasync.py Add dependencies with yield (used as context managers) (#595) 2019-10-09 13:01:58 -05:00
test_filter_pydantic_sub_model.py 📝 Use Optional in docs (#1644) 2020-06-28 20:13:30 +02:00
test_forms_from_non_typing_sequences.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_get_request_body.py Add support for adding OpenAPI schema for GET requests with a body (#1626) 2020-07-19 12:17:50 +02:00
test_http_connection_injection.py Add support for injecting HTTPConnection (#1827) 2020-08-09 15:56:41 +02:00
test_include_route.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_include_router_defaults_overrides.py Add support for shared/top-level parameters (dependencies, tags, etc) (#2434) 2020-11-29 18:32:18 +01:00
test_infer_param_optionality.py 📝 Use Optional in docs (#1644) 2020-06-28 20:13:30 +02:00
test_inherited_custom_class.py Re-export utils from Starlette (#1064) 2020-03-01 21:49:20 +01:00
test_invalid_path_param.py 🐛 Fix path and query parameters receiving dict as valid (#287) 2019-06-03 21:59:40 +04:00
test_invalid_sequence_param.py 📝 Use Optional in docs (#1644) 2020-06-28 20:13:30 +02:00
test_jsonable_encoder.py ⬆ Require Pydantic > 1.0 (#1862) 2020-08-09 22:17:08 +02:00
test_local_docs.py Allow disabling Google fonts in ReDoc (#481) 2019-08-30 19:00:55 -05:00
test_multi_body_errors.py 🐛 Fix body validation error response, remove variable name when it is not embedded (#1553) 2020-06-14 18:07:39 +02:00
test_multi_query_errors.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_multipart_installation.py ✏ Fix typos in docs and source examples (#2102) 2020-11-05 23:14:17 +01:00
test_no_swagger_ui_redirect.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_openapi_servers.py Add support for OpenAPI servers metadata (#1547) 2020-06-14 15:38:29 +02:00
test_operations_signatures.py Add include, exclude, and by_alias to path operation methods (#264) 2019-05-27 16:08:13 +04:00
test_param_class.py 📝 Use Optional in docs (#1644) 2020-06-28 20:13:30 +02:00
test_param_in_path_and_dependency.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_params_repr.py Implement __repr__ methods for path parameters to simplify debugging (#1560) 2020-06-13 01:22:30 +02:00
test_path.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_put_no_body.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_query.py Re-export utils from Starlette (#1064) 2020-03-01 21:49:20 +01:00
test_repeated_cookie_headers.py 🐛 Fix duplicated headers set by indirect dependencies (#1386) 2020-06-13 14:44:51 +02:00
test_repeated_dependency_schema.py Re-export utils from Starlette (#1064) 2020-03-01 21:49:20 +01:00
test_request_body_parameters_media_type.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_response_by_alias.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_response_change_status_code.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_response_class_no_mediatype.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_response_code_no_body.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_response_model_invalid.py 🐛 Admit valid types for Pydantic fields as responses models (#1017) 2020-02-29 14:04:35 +01:00
test_response_model_sub_types.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_router_events.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_router_prefix_with_template.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_api_key_cookie.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_api_key_cookie_optional.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_api_key_header.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_api_key_header_optional.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_api_key_query.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_api_key_query_optional.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_http_base.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_http_base_optional.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_http_basic_optional.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_http_basic_realm.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_http_bearer.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_http_bearer_optional.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_http_digest.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_http_digest_optional.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_oauth2.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_security_oauth2_authorization_code_bearer.py Auto-generate OpenAPI servers from root_path (#1596) 2020-07-10 19:28:18 +02:00
test_security_oauth2_optional.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_security_oauth2_password_bearer_optional.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_openid_connect.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_security_openid_connect_optional.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_serialize_response.py 🎨 Add typing.Optional to variables that accept None as value (#1731) 2020-08-03 14:29:07 +02:00
test_serialize_response_dataclass.py 🎨 Add typing.Optional to variables that accept None as value (#1731) 2020-08-03 14:29:07 +02:00
test_serialize_response_model.py 🎨 Add typing.Optional to variables that accept None as value (#1731) 2020-08-03 14:29:07 +02:00
test_skip_defaults.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_starlette_exception.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_starlette_urlconvertors.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_sub_callbacks.py Add support for shared/top-level parameters (dependencies, tags, etc) (#2434) 2020-11-29 18:32:18 +01:00
test_swagger_ui_init_oauth.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
test_union_body.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_union_inherited_body.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_validate_response.py 🎨 Add typing.Optional to variables that accept None as value (#1731) 2020-08-03 14:29:07 +02:00
test_validate_response_dataclass.py 🎨 Add typing.Optional to variables that accept None as value (#1731) 2020-08-03 14:29:07 +02:00
test_validate_response_recursive.py Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
test_ws_router.py 🔧 Add Flake8 linting (#1774) 2020-08-09 12:54:05 +02:00
utils.py 📝 Add docs for correctly using Peewee (#789) 2019-12-13 11:29:18 +01:00