Skip to content

Commit e08d35f

Browse files
committed
Add benchmark test for request.get_json
1 parent d40b3dc commit e08d35f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_http.py

+14
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,17 @@ def test_http_response_does_not_have_explicit_output(self):
166166
self.assertIsNone(
167167
getattr(http.HttpResponseConverter, 'has_implicit_output', None)
168168
)
169+
170+
171+
def test_http_request_body_json(benchmark):
172+
data: bytes = b'{ "result": "OK", "message": "Everything is ok", "code": 200 }'
173+
request = func.HttpRequest(
174+
method='POST',
175+
url='/foo',
176+
body=data,
177+
headers={
178+
'Content-Type': 'application/json; charset=utf-8'
179+
}
180+
)
181+
182+
benchmark(request.get_json)

0 commit comments

Comments
 (0)