Skip to content

Commit

Permalink
Update tests for body in GET and DELETE
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruwann committed Jun 13, 2023
1 parent 19b7fcc commit 074f3b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/api/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
6 changes: 3 additions & 3 deletions tests/test_resolver_methodview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}
Expand All @@ -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"}}
Expand Down

0 comments on commit 074f3b0

Please sign in to comment.