def test_resources_can_read_request_stream_during_tests(self):
"""Make sure we can perform a simple request during testing.
Originally, testing would fail after performing a request because no
size was specified when calling `wsgiref.validate.InputWrapper.read()`
via `req.stream.read()`"""
app = falcon.API()
type_route = '/type'
app.add_route(type_route, TypeResource())
client = testing.TestClient(app)
result = client.simulate_post(path=type_route, body='hello')
assert result.status == falcon.HTTP_200
assert result.json == {'data': 'hello'}
test_wsgiref_inputwrapper_with_size.py 文件源码
python
阅读 16
收藏 0
点赞 0
评论 0
评论列表
文章目录