-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathquota_test.go
79 lines (62 loc) · 1.39 KB
/
quota_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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package chatnio
import (
"fmt"
"github.com/Deeptrain-Community/chatnio-api-go/utils"
"testing"
)
func TestInstance_GetQuota(t *testing.T) {
if !instance.IsAuthenticated() {
return
}
quota, err := instance.GetQuota()
if err != nil {
t.Error(err)
}
fmt.Println(fmt.Sprintf("[quota] get quota: %f", quota))
}
func TestInstance_BuyQuota(t *testing.T) {
if true {
return
} // buy quota is disabled because it's not free
if !instance.IsAuthenticated() {
return
}
err := instance.BuyQuota(1)
if err != nil {
t.Error(err)
}
fmt.Println(fmt.Sprintf("[quota] buy quota: status %t", err == nil))
}
func TestInstance_GetPackage(t *testing.T) {
if !instance.IsAuthenticated() {
return
}
pkg, err := instance.GetPackage()
if err != nil {
t.Error(err)
}
fmt.Println(fmt.Sprintf("[quota] get package: %s", utils.MarshalForm(*pkg)))
}
func TestInstance_GetSubscription(t *testing.T) {
if !instance.IsAuthenticated() {
return
}
sub, err := instance.GetSubscription()
if err != nil {
t.Error(err)
}
fmt.Println(fmt.Sprintf("[quota] get subscription: %s", utils.MarshalForm(*sub)))
}
func TestInstance_Subscribe(t *testing.T) {
if true {
return
} // subscribe is disabled because it's not free
if !instance.IsAuthenticated() {
return
}
err := instance.Subscribe(1, 1)
if err != nil {
t.Error(err)
}
fmt.Println(fmt.Sprintf("[quota] subscribe: status %t", err == nil))
}