MCPcopy Create free account
hub / github.com/doraemonext/wechat-python-sdk / test_access_token

Method test_access_token

tests/test_basic.py:107–117  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

105 self.assertEqual(wechat.conf.jsapi_ticket, self.fixtures_jsapi_ticket)
106
107 def test_access_token(self):
108 # 测试无 appid 和 appsecret 初始化
109 wechat = WechatBasic()
110 with self.assertRaises(NeedParamError):
111 print(wechat.conf.access_token)
112
113 # 测试有 appid 和 appsecret 初始化
114 wechat = WechatBasic(appid=self.appid, appsecret=self.appsecret)
115 with HTTMock(wechat_api_mock):
116 access_token = wechat.conf.access_token
117 self.assertEqual(access_token, self.fixtures_access_token)
118
119 def test_jsapi_ticket(self):
120 # 测试无 appid 和 appsecret 初始化

Callers

nothing calls this directly

Calls 1

WechatBasicClass · 0.90

Tested by

no test coverage detected