forked from wasabee-project/Wasabee-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_agent_test.go
53 lines (44 loc) · 947 Bytes
/
model_agent_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
package wasabee_test
import (
"github.com/wasabee-project/Wasabee-Server"
"testing"
)
func TestInitAgent(t *testing.T) {
_, err := gid.InitAgent()
if err != nil {
t.Errorf(err.Error())
}
err = gid.StatusLocationEnable()
if err != nil {
t.Errorf(err.Error())
}
err = gid.StatusLocationDisable()
if err != nil {
t.Errorf(err.Error())
}
var ad wasabee.AgentData
err = gid.GetAgentData(&ad)
if err != nil {
t.Errorf(err.Error())
}
// xxx check a value or two in ad
}
func TestAgentLocation(t *testing.T) {
err := gid.AgentLocation("33.148", "-96.787")
if err != nil {
t.Errorf(err.Error())
}
}
func TestAgentDelete(t *testing.T) {
// special case google ID that is not really used
ngid := wasabee.GoogleID("104743827901423568948")
_, err := ngid.InitAgent()
if err != nil {
t.Errorf(err.Error())
}
// add to a team, do some stuff, etc...
err = ngid.Delete()
if err != nil {
t.Errorf(err.Error())
}
}