MCPcopy
hub / github.com/wechatpy/wechatpy / test_iter_followers

Method test_iter_followers

tests/test_client.py:260–278  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

258 self.assertEqual(2, result['count'])
259
260 def test_iter_followers(self):
261 @urlmatch(netloc=r'(.*\.)?api\.weixin\.qq\.com$', query=r'.*next_openid=[^&]+')
262 def next_openid_mock(url, request):
263 """伪造第二页的请求"""
264 content = {
265 "total": 2,
266 "count": 0,
267 "next_openid": ""
268 }
269 headers = {
270 'Content-Type': 'application/json'
271 }
272 return response(200, content, headers, request=request)
273
274 with HTTMock(next_openid_mock, wechat_api_mock):
275 users = list(self.client.user.iter_followers())
276 self.assertEqual(2, len(users))
277 self.assertIn("OPENID1", users)
278 self.assertIn("OPENID2", users)
279
280 def test_update_user_remark(self):
281 with HTTMock(wechat_api_mock):

Callers

nothing calls this directly

Calls 1

iter_followersMethod · 0.80

Tested by

no test coverage detected