|
- package main
-
- import (
- "fmt"
- "math/rand"
- "testing"
- "time"
- )
-
- var toUser = "oUN420bxqFqlx0ZQHciUOesZO3PE"
-
- func randinit() {
- rand.Seed(time.Now().UnixNano())
- }
-
- var letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
-
- func RandStringRunes(n int) string {
- b := make([]rune, n)
- for i := range b {
- b[i] = letterRunes[rand.Intn(len(letterRunes))]
- }
- return string(b)
- }
-
- func TestSendTxt(t *testing.T) {
- SetupConfig()
- msg := fmt.Sprintf("测试消息, %s ", time.Now().String())
-
- randinit()
- msg = RandStringRunes(2048)
-
- kfSendTxt(toUser, msg)
- }
-
- func TestSendPic(t *testing.T) {
- SetupConfig()
- kfSendPic(toUser, "media_for_test/200x200.png")
- }
-
- func TestSendVoice(t *testing.T) {
- SetupConfig()
- kfSendVoice(toUser, "media_for_test/example.amr")
- //kfSendVoiceByMediaID(toUser, "8Tc-pcFxEMtbO6T71AaL0A16taJUpwolXpB06mBBfaPZ68R3__1nN7HuZAUyW8xR")
- }
-
- func TestSendVideo(t *testing.T) {
- SetupConfig()
- //kfSendVideo(toUser, "media_for_test/video.mp4", "测试时品", "普通描述", "media_for_test/music-thumb.jpg")
- kfSendVideoByMediaID(toUser,
- "xwcgPCY8TRHP_PIy_4qunL8ad9mq7vD3hc9-OpNVRKG1qTwjKkQHN4GKb9mAcJ3J",
- "测试标题",
- "测试描述信息",
- "6QKTfDxkQS2ACDzVhY0ddKjlIsBTyB6cf9fFWG88uwbJ0Mlh_gSIMxnaGvdqU4y0")
- }
-
- func TestSendMusic(t *testing.T) {
- SetupConfig()
- }
-
- func TestSendArticle(t *testing.T) {
- SetupConfig()
- }
|