test_list.py 文件源码

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

项目:falcon-api 作者: Opentopic 项目源码 文件源码
def test_on_options(self):
        """
        need to check if status of the response is set for 200 and
        """
        env = create_environ(path='/')
        req = Request(env)
        req.context = {
            'doc': {}
        }
        resp = Response()
        resource = mongoengine.CollectionResource(objects_class=FakeObjectList, max_limit=2)
        resource.on_options(req=req, resp=resp)
        self.assertEqual(resp.get_header('Allow'), 'GET, HEAD, OPTIONS, POST, PUT')
        self.assertEqual(resp.body, {
            'name': 'FakeObjectList',
            'description': 'Extend list to match interface of List resource',
        })
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号