From 073fb9b89ac4135df1f535cddb528f936218c7f2 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Fri, 23 Sep 2022 11:51:53 +0200 Subject: [PATCH] [#222] update content type parameter test --- tests/test_content_type_headers.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/test_content_type_headers.py b/tests/test_content_type_headers.py index 3b972e15..fce740f0 100644 --- a/tests/test_content_type_headers.py +++ b/tests/test_content_type_headers.py @@ -46,19 +46,18 @@ def _generate_schema(): def test_json_content_type(): schema = _generate_schema() - get_operation = schema.paths["/json"]["get"] - post_operation = schema.paths["/json"]["post"] + get_operation = schema["paths"]["/json"]["get"] + post_operation = schema["paths"]["/json"]["post"] - assert get_operation["parameters"] == [] + assert "parameters" not in get_operation assert post_operation["parameters"] == [ - OpenApiParameter( - name="Content-Type", - location=OpenApiParameter.HEADER, - type=OpenApiTypes.STR, - required=True, - enum=["application/json"], - description=_("Content type of the request body."), - ) + { + "description": "Content type of the request body.", + "in": "header", + "name": "Content-Type", + "required": True, + "schema": {"enum": ["application/json"], "type": "string"}, + } ]