test_wsgiref_inputwrapper_with_size.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:deb-python-falcon 作者: openstack 项目源码 文件源码
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'}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号