-
Notifications
You must be signed in to change notification settings - Fork 0
/
bots_test.go
42 lines (37 loc) · 979 Bytes
/
bots_test.go
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
package dbl_go
import (
"net/http"
"os"
"testing"
)
func TestDBL_GetBot(t *testing.T) {
dbl := NewDBL(os.Getenv("TOKEN"), &http.Client{})
_, err := dbl.GetBot("242730576195354624")
if err != nil {
t.Errorf("GetBot threw an error: %v", err)
}
}
func TestDBL_CheckUserVote(t *testing.T) {
dbl := NewDBL(os.Getenv("TOKEN"), &http.Client{})
_, err := dbl.CheckUserVote("242730576195354624", "435066999987634177")
if err != nil {
t.Errorf("GetRecentVotes threw an error: %v", err)
}
}
func TestDBL_GetBotStats(t *testing.T) {
dbl := NewDBL(os.Getenv("TOKEN"), &http.Client{})
_, err := dbl.GetBotStats("242730576195354624")
if err != nil {
t.Errorf("GetBotStats threw an error: %v", err)
}
}
func TestDBL_PostBotStats(t *testing.T) {
dbl := NewDBL(os.Getenv("TOKEN"), &http.Client{})
err := dbl.PostBotStats("242730576195354624", &Stats{
ServerCount: 69727,
ShardCount: 70,
})
if err != nil {
t.Errorf("PostBotStats threw an error: %v", err)
}
}