Exemplo n.º 1
0
    def test_get_access_token_success(self, mock_data):
        """Test get access token."""
        mock_data.return_value = {
            'access_token': 'access_token',
            'expires_in': 7200
        }
        resp = WechatAPI.get_access_token(self.appid, self.appsecret)

        self.assertEqual(resp.get('access_token'), 'access_token')
Exemplo n.º 2
0
 def test_get_access_token_failure(self):
     """Test."""
     result = WechatAPI.get_access_token(self.appid, self.appsecret)
     self.assertIn('errmsg', result)
     self.assertIn('requrl', result)