-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathcustom_test.go
More file actions
50 lines (42 loc) · 776 Bytes
/
Copy pathcustom_test.go
File metadata and controls
50 lines (42 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package weixin
import (
"os"
"testing"
)
func TestSendCustomMsg(t *testing.T) {
ct := &CustText{
Content: "我们都是好孩子",
}
err := SendCustomMsg("ozmLcjnM7vnrXmb3DimFLi0EOiY8", ct)
if err != nil {
t.Error(err)
t.FailNow()
}
}
func TestAddCustom(t *testing.T) {
err := AddCustom("shangxuejin@gmail.com", "migo", "87654321")
if err != nil {
t.Error(err)
t.FailNow()
}
}
func TestUploadHeading(t *testing.T) {
file, err := os.Open("custom_test.go")
if err != nil {
t.Error(err)
t.FailNow()
}
err = UploadHeading("shangxuejin@gmail.com", file)
if err != nil {
t.Error(err)
t.FailNow()
}
}
func TestGetCustomList(t *testing.T) {
accs, err := GetCustomList()
if err != nil {
t.Error(err)
t.FailNow()
}
t.Logf("%v", accs)
}