- up
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi"
|
"git.rosy.net.cn/baseapi"
|
||||||
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
@@ -64,8 +65,8 @@ func TestGetCoordinateDistrictCode(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetCoordinateTownInfo(t *testing.T) {
|
func TestGetCoordinateTownInfo(t *testing.T) {
|
||||||
dongguanLng := 120.982657
|
dongguanLng := 120.74567
|
||||||
dongguanLat := 31.410355
|
dongguanLat := 31.69742
|
||||||
townName, townCode := autonaviAPI.GetCoordinateTownInfo(dongguanLng, dongguanLat)
|
townName, townCode := autonaviAPI.GetCoordinateTownInfo(dongguanLng, dongguanLat)
|
||||||
if townName != "周市镇" || townCode != "320583102000" {
|
if townName != "周市镇" || townCode != "320583102000" {
|
||||||
t.Fatalf("townName:%s, townCode:%s", townName, townCode)
|
t.Fatalf("townName:%s, townCode:%s", townName, townCode)
|
||||||
@@ -73,12 +74,12 @@ func TestGetCoordinateTownInfo(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetDistricts(t *testing.T) {
|
func TestGetDistricts(t *testing.T) {
|
||||||
districtList, err := autonaviAPI.GetDistricts(1, "东莞")
|
districtList, err := autonaviAPI.GetDistricts(4, "常熟市")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
if len(districtList) == 0 {
|
if len(districtList) == 0 {
|
||||||
t.Fatal("should have ditrict")
|
t.Fatal("should have ditrict")
|
||||||
}
|
}
|
||||||
// t.Log(utils.Format4Output(districtList, false))
|
t.Log(utils.Format4Output(districtList, false))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user