Skip to content

Commit

Permalink
Add test for cf09a90.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sami Salonen committed Feb 24, 2020
1 parent e57c22d commit 58ac9f2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_falconparser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import falcon.testing

from webargs.testing import CommonTestCase
from tests.apps.falcon_app import create_app
Expand Down Expand Up @@ -42,3 +43,10 @@ def test_invalid_json(self, testapp):
def test_parsing_headers(self, testapp):
res = testapp.get("/echo_headers", headers={"name": "Fred"})
assert res.json == {"NAME": "Fred"}

# `falcon.testing.TestClient.simulate_request` parses request with `wsgiref`
def test_body_parsing_works_with_simulate(self, testapp):
app = self.create_app()
client = falcon.testing.TestClient(app)
res = client.simulate_post("/echo_json", json={"name": "Fred"},)
assert res.json == {"name": "Fred"}

0 comments on commit 58ac9f2

Please sign in to comment.