From fa41279bda46627d83db215ae5ee7bc50696b08e Mon Sep 17 00:00:00 2001 From: Maksim Zayats Date: Tue, 17 Mar 2026 01:21:56 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20test=20to=20cover=20metada?= =?UTF-8?q?ta=20helper=20routes=20for=20full=20coverage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ookie_header_param_models_with_siblings.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/test_query_cookie_header_param_models_with_siblings.py b/tests/test_query_cookie_header_param_models_with_siblings.py index 673d34151a..163d57168a 100644 --- a/tests/test_query_cookie_header_param_models_with_siblings.py +++ b/tests/test_query_cookie_header_param_models_with_siblings.py @@ -147,6 +147,18 @@ def test_query_openapi_metadata(): assert documented_query["deprecated"] is True +def test_query_openapi_metadata_runtime(): + response = client.get( + "/query/openapi-metadata", + params={"limit": 10, "q": "hello", "documented_query": "value"}, + ) + assert response.status_code == 200 + assert response.json() == { + "m": {"limit": 10, "q": "hello"}, + "documented_query": "value", + } + + def test_header_model_only_still_flattens(): response = client.get( "/header/only", @@ -215,6 +227,25 @@ def test_header_openapi_metadata_and_hidden_params(): assert "hidden-header" not in parameter_names +def test_header_openapi_metadata_runtime(): + response = client.get( + "/header/openapi-metadata", + headers=[ + ("x-token", "abc"), + ("x-trace", "one"), + ("x-trace", "two"), + ("hidden-header", "secret"), + ("documented-header", "shown"), + ], + ) + assert response.status_code == 200 + assert response.json() == { + "h": {"x_token": "abc", "x_trace": ["one", "two"]}, + "hidden_header": "secret", + "documented_header": "shown", + } + + def test_cookie_model_only_still_flattens(): with client as c: c.cookies.clear()