kefu/tools/wechat/wechat_test.go

25 lines
673 B
Go

package wechat
import (
cache2 "github.com/silenceper/wechat/v2/cache"
"log"
"testing"
)
func TestGetAccessToken(t *testing.T) {
GetAccessToken("wx2987986f14daa9fc", "0d5a220a35cb7edcf1943459258fea2c")
}
func TestCreateQrTicket(t *testing.T) {
token := GetAccessToken("wx2987986f14daa9fc", "0d5a220a35cb7edcf1943459258fea2c")
CreateQrImgUrl(token.AccessToken, "agent_20291289&2378278")
}
func TestGetWechatOfficialNickname(t *testing.T) {
cache := cache2.NewMemory()
userInfo, err := GetWechatOfficialNickname("wx2987986f14daa9fc",
"0d5a220a35cb7edcf1943459258fea2c",
"taoshihan1",
"021bynFa1G5DfE05p5Ga1RxqK50bynF0",
cache)
log.Println(userInfo, err)
}