test_sort.py 文件源码

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

项目:server-client-python 作者: tableau 项目源码 文件源码
def test_sort_asc(self):
        with requests_mock.mock() as m:
            m.get(requests_mock.ANY)
            url = "http://test/api/2.3/sites/dad65087-b08b-4603-af4e-2887b8aafc67/workbooks"
            opts = TSC.RequestOptions(pagesize=13, pagenumber=13)
            opts.sort.add(TSC.Sort(TSC.RequestOptions.Field.Name,
                                   TSC.RequestOptions.Direction.Asc))

            resp = self.server.workbooks._make_request(requests.get,
                                                       url,
                                                       content=None,
                                                       request_object=opts,
                                                       auth_token='j80k54ll2lfMZ0tv97mlPvvSCRyD0DOM',
                                                       content_type='text/xml')

            self.assertEqual(resp.request.query, 'pagenumber=13&pagesize=13&sort=name:asc')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号