MCPcopy
hub / github.com/wechatpy/wechatpy / next_openid_mock

Method next_openid_mock

tests/test_client.py:262–272  ·  view source on GitHub ↗

伪造第二页的请求

(url, request)

Source from the content-addressed store, hash-verified

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())

Callers

nothing calls this directly

Calls 3

decodeMethod · 0.80
wechat_api_mockFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected