def test_endpoint_list_route(self):
with responses.RequestsMock() as rsps:
rsps.add_callback(
responses.POST, MOCK_API_URL + '/users/notify',
callback=request_callback,
content_type='application/json',
)
response = generic_client.users().notify(unread=3)
self.assertEqual(response.json(), {'unread': 3})
with responses.RequestsMock() as rsps:
rsps.add_callback(
responses.GET, MOCK_API_URL + '/users/notify',
callback=request_callback,
content_type='application/json',
)
response = generic_client.users(_method='get').notify(unread=3)
self.assertEqual(response.json(), {'unread': 3})
test_routes.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录