init
This commit is contained in:
46
gps_tool/an_na_qi_client_test.go
Normal file
46
gps_tool/an_na_qi_client_test.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package gps_tool
|
||||
|
||||
import (
|
||||
"log"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAnNaQiGpsClient_GetGpsInfo(t *testing.T) {
|
||||
type fields struct {
|
||||
AppCode string
|
||||
Host string
|
||||
}
|
||||
type args struct {
|
||||
longitude float64
|
||||
latitude float64
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
fields fields
|
||||
args args
|
||||
wantRes interface{}
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "test1",
|
||||
fields: fields{
|
||||
AppCode: "",
|
||||
Host: "https://jmgeocode.market.alicloudapi.com",
|
||||
},
|
||||
args: args{
|
||||
longitude: 109.770280,
|
||||
latitude: 23.565979,
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
n := &AnNaQiGpsClient{
|
||||
AppCode: tt.fields.AppCode,
|
||||
Host: tt.fields.Host,
|
||||
}
|
||||
gotRes, err := n.GetGpsInfo(tt.args.longitude, tt.args.latitude)
|
||||
log.Println(gotRes, err)
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user