From 074f3b0a8f754bcab502d27dfeee3662635d9ba8 Mon Sep 17 00:00:00 2001 From: Ruwan Date: Sun, 11 Jun 2023 08:30:30 +0200 Subject: [PATCH] Update tests for body in GET and DELETE --- tests/api/test_parameters.py | 4 ++-- tests/test_resolver_methodview.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/api/test_parameters.py b/tests/api/test_parameters.py index ab58fd193..991cb5ef7 100644 --- a/tests/api/test_parameters.py +++ b/tests/api/test_parameters.py @@ -456,11 +456,11 @@ def test_args_kwargs(simple_app): app_client = simple_app.test_client() resp = app_client.get("/v1.0/query-params-as-kwargs") assert resp.status_code == 200 - assert resp.json() == {} + assert resp.json() == {"body": {}} resp = app_client.get("/v1.0/query-params-as-kwargs?foo=a&bar=b") assert resp.status_code == 200 - assert resp.json() == {"foo": "a"} + assert resp.json() == {"foo": "a", "body": {}} if simple_app._spec_file == "openapi.yaml": body = {"foo": "a", "bar": "b"} diff --git a/tests/test_resolver_methodview.py b/tests/test_resolver_methodview.py index 24e812ac8..e14a0f652 100644 --- a/tests/test_resolver_methodview.py +++ b/tests/test_resolver_methodview.py @@ -190,10 +190,10 @@ def test_method_view_resolver_integration(spec): client = method_view_app.test_client() r = client.get("/v1.0/pets") - assert r.json() == [{"name": "get"}] + assert r.json() == {"name": "get", "body": {}} r = client.get("/v1.0/pets/1") - assert r.json() == {"name": "get", "petId": 1} + assert r.json() == {"name": "get", "petId": 1, "body": {}} r = client.post("/v1.0/pets", json={"name": "Musti"}) assert r.json() == {"name": "post", "body": {"name": "Musti"}} @@ -216,7 +216,7 @@ def test_method_resolver_integration(spec, app_class): assert r.json() == [{"name": "search"}] r = client.get("/v1.0/pets/1") - assert r.json() == {"name": "get", "petId": 1} + assert r.json() == {"name": "get", "petId": 1, "body": {}} r = client.post("/v1.0/pets", json={"name": "Musti"}) assert r.json() == {"name": "post", "body": {"name": "Musti"}}