From 2a48bb23c724daa28234144a4ac9b59b4b6c029f Mon Sep 17 00:00:00 2001 From: bilalAlpaslan Date: Wed, 13 Apr 2022 01:41:56 +0300 Subject: [PATCH] APIKey scheme name default changed --- tests/test_security_api_key_cookie.py | 4 +--- tests/test_security_api_key_cookie_optional.py | 4 +--- tests/test_security_api_key_header.py | 4 +--- tests/test_security_api_key_header_optional.py | 4 +--- tests/test_security_api_key_multiple_header.py | 8 +++++--- tests/test_security_api_key_query.py | 4 +--- tests/test_security_api_key_query_optional.py | 4 +--- .../test_tutorial/test_request_files/test_tutorial001.py | 2 +- 8 files changed, 12 insertions(+), 22 deletions(-) diff --git a/tests/test_security_api_key_cookie.py b/tests/test_security_api_key_cookie.py index b0b77ac85..b3c3fec56 100644 --- a/tests/test_security_api_key_cookie.py +++ b/tests/test_security_api_key_cookie.py @@ -43,9 +43,7 @@ openapi_schema = { } }, "components": { - "securitySchemes": { - "key": {"type": "apiKey", "name": "key", "in": "cookie"} - } + "securitySchemes": {"key": {"type": "apiKey", "name": "key", "in": "cookie"}} }, } diff --git a/tests/test_security_api_key_cookie_optional.py b/tests/test_security_api_key_cookie_optional.py index 451738147..f1fe7b2f3 100644 --- a/tests/test_security_api_key_cookie_optional.py +++ b/tests/test_security_api_key_cookie_optional.py @@ -50,9 +50,7 @@ openapi_schema = { } }, "components": { - "securitySchemes": { - "key": {"type": "apiKey", "name": "key", "in": "cookie"} - } + "securitySchemes": {"key": {"type": "apiKey", "name": "key", "in": "cookie"}} }, } diff --git a/tests/test_security_api_key_header.py b/tests/test_security_api_key_header.py index 1816c7252..cb0379e0e 100644 --- a/tests/test_security_api_key_header.py +++ b/tests/test_security_api_key_header.py @@ -43,9 +43,7 @@ openapi_schema = { } }, "components": { - "securitySchemes": { - "key": {"type": "apiKey", "name": "key", "in": "header"} - } + "securitySchemes": {"key": {"type": "apiKey", "name": "key", "in": "header"}} }, } diff --git a/tests/test_security_api_key_header_optional.py b/tests/test_security_api_key_header_optional.py index b7900176c..9ecbdc4a0 100644 --- a/tests/test_security_api_key_header_optional.py +++ b/tests/test_security_api_key_header_optional.py @@ -49,9 +49,7 @@ openapi_schema = { } }, "components": { - "securitySchemes": { - "key": {"type": "apiKey", "name": "key", "in": "header"} - } + "securitySchemes": {"key": {"type": "apiKey", "name": "key", "in": "header"}} }, } diff --git a/tests/test_security_api_key_multiple_header.py b/tests/test_security_api_key_multiple_header.py index 16c0d56fb..c6b4b5fc1 100644 --- a/tests/test_security_api_key_multiple_header.py +++ b/tests/test_security_api_key_multiple_header.py @@ -29,7 +29,9 @@ def read_current_user(current_user: User = Depends(get_current_user)): @app.get("/another_key/users/me") -def read_current_user_another_key(current_user: User = Depends(get_current_user_with_another_key)): +def read_current_user_another_key( + current_user: User = Depends(get_current_user_with_another_key), +): return current_user @@ -64,12 +66,12 @@ openapi_schema = { "operationId": "read_current_user_another_key_another_key_users_me_get", "security": [{"another_key": []}], } - } + }, }, "components": { "securitySchemes": { "key": {"type": "apiKey", "name": "key", "in": "header"}, - "another_key": {"type": "apiKey", "name": "another_key", "in": "header"} + "another_key": {"type": "apiKey", "name": "another_key", "in": "header"}, } }, } diff --git a/tests/test_security_api_key_query.py b/tests/test_security_api_key_query.py index 8bcb9334d..96853c452 100644 --- a/tests/test_security_api_key_query.py +++ b/tests/test_security_api_key_query.py @@ -43,9 +43,7 @@ openapi_schema = { } }, "components": { - "securitySchemes": { - "key": {"type": "apiKey", "name": "key", "in": "query"} - } + "securitySchemes": {"key": {"type": "apiKey", "name": "key", "in": "query"}} }, } diff --git a/tests/test_security_api_key_query_optional.py b/tests/test_security_api_key_query_optional.py index b9e65d347..273c3a809 100644 --- a/tests/test_security_api_key_query_optional.py +++ b/tests/test_security_api_key_query_optional.py @@ -49,9 +49,7 @@ openapi_schema = { } }, "components": { - "securitySchemes": { - "key": {"type": "apiKey", "name": "key", "in": "query"} - } + "securitySchemes": {"key": {"type": "apiKey", "name": "key", "in": "query"}} }, } diff --git a/tests/test_tutorial/test_request_files/test_tutorial001.py b/tests/test_tutorial/test_request_files/test_tutorial001.py index c1537f445..841116e30 100644 --- a/tests/test_tutorial/test_request_files/test_tutorial001.py +++ b/tests/test_tutorial/test_request_files/test_tutorial001.py @@ -162,7 +162,7 @@ def test_post_file(tmp_path): def test_post_large_file(tmp_path): - default_pydantic_max_size = 2 ** 16 + default_pydantic_max_size = 2**16 path = tmp_path / "test.txt" path.write_bytes(b"x" * (default_pydantic_max_size + 1))