- refactor AccessAPINoPage.

- product related api added.
This commit is contained in:
gazebo
2018-08-26 09:57:43 +08:00
parent 259a8c896a
commit 8357982612
7 changed files with 625 additions and 69 deletions

View File

@@ -45,7 +45,7 @@ func TestAccessAPI(t *testing.T) {
}
func TestAccessAPINoPage(t *testing.T) {
result, err := jdapi.AccessAPINoPage("address/allcities", nil, []string{"yn"}, nil)
result, err := jdapi.AccessAPINoPage("address/allcities", nil, []string{"yn"}, nil, nil)
if err != nil {
t.Fatalf("TestAccessAPINoPage return error:%v", err)
}
@@ -67,12 +67,12 @@ func TestAccessAPIHavePage(t *testing.T) {
"pageNo": 1,
"pageSize": 20,
}
skuInfo, err := jdapi.AccessAPIHavePage("pms/querySkuInfos", jdParams, nil, []string{"skuName", "skuId"}, nil)
skuInfo, totalCount, err := jdapi.AccessAPIHavePage("pms/querySkuInfos", jdParams, nil, []string{"skuName", "skuId"}, nil)
if err != nil {
t.Fatalf("AccessAPIHavePage return error:%v", err)
}
if len(skuInfo) == 0 {
if len(skuInfo) == 0 || totalCount == 0 {
t.Fatal("sku info is empty")
}
oneSku := skuInfo[0].(map[string]interface{})
@@ -102,12 +102,12 @@ func TestOrderQuery(t *testing.T) {
jdParams := map[string]interface{}{
"orderId": "813344594000041",
}
result, err := jdapi.OrderQuery(jdParams)
result, totalCount, err := jdapi.OrderQuery(jdParams)
if err != nil {
t.Fatalf("OrderQuery return error:%v", err)
}
if len(result) == 0 {
if len(result) == 0 || totalCount == 0 {
t.Fatal("OrderQuery return empty data")
}
buyerCityOk := false