-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtrackprocess_test.go
40 lines (35 loc) · 1.28 KB
/
trackprocess_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
package yingyan_test
import (
"encoding/json"
"fmt"
"testing"
"time"
"github.com/cnjack/yingyan.sdk"
)
func TestS_GetLatestPoint(t *testing.T) {
client := yingyan.NewClient("do0znBH8Du2YflrDtZ6osFGVXOEG3osi", "fOBSnqpZyppQ2ImXP7HfqFeeY17MouzZ", 135928)
body, err := client.GetLatestPoint("run_1", &yingyan.ProcessOption{}, yingyan.BaiDuCoordType)
if err != nil {
t.Error("EntityAdd err :", err.Error())
}
fmt.Println(body)
}
func TestS_GetDistance(t *testing.T) {
start := time.Now().Unix() - 6300
client := yingyan.NewClient("do0znBH8Du2YflrDtZ6osFGVXOEG3osi", "fOBSnqpZyppQ2ImXP7HfqFeeY17MouzZ", 135928)
body, err := client.GetDistance("run_1", true, start, time.Now().Unix(), &yingyan.ProcessOption{}, yingyan.NoSupplement)
if err != nil {
t.Error("EntityAdd err :", err.Error())
}
fmt.Println(body)
}
func TestS_GetTrack(t *testing.T) {
start := time.Now().Unix() - 6300
client := yingyan.NewClient("do0znBH8Du2YflrDtZ6osFGVXOEG3osi", "fOBSnqpZyppQ2ImXP7HfqFeeY17MouzZ", 135928)
body, err := client.GetTrack("run_1", true, start, time.Now().Unix(), &yingyan.ProcessOption{}, yingyan.NoSupplement, yingyan.BaiDuCoordType, yingyan.AscSortType, 1, 100)
if err != nil {
t.Error("EntityAdd err :", err.Error())
}
bodyByte, _ := json.Marshal(body)
fmt.Println(string(bodyByte))
}