- 添加了部分到家订单级促销
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func TestQueryPageBrandInfo(t *testing.T) {
|
||||
result, _, err := jdapi.QueryPageBrandInfo(0, 0, 0, "")
|
||||
result, _, err := api.QueryPageBrandInfo(0, 0, 0, "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -19,7 +19,7 @@ func TestQueryPageBrandInfo(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestQueryCategoriesByOrgCode(t *testing.T) {
|
||||
result, err := jdapi.QueryCategoriesByOrgCode()
|
||||
result, err := api.QueryCategoriesByOrgCode()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -29,7 +29,7 @@ func TestQueryCategoriesByOrgCode(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestQueryChildCategoriesForOP(t *testing.T) {
|
||||
result, err := jdapi.QueryChildCategoriesForOP(0)
|
||||
result, err := api.QueryChildCategoriesForOP(0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -58,7 +58,7 @@ func TestBatchUpdateOutSkuId(t *testing.T) {
|
||||
|
||||
func TestQuerySkuInfos(t *testing.T) {
|
||||
pageSize := 20
|
||||
result, totalCount, err := jdapi.QuerySkuInfos("", 0, 0, pageSize, true)
|
||||
result, totalCount, err := api.QuerySkuInfos("", 0, 0, pageSize, true)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -73,7 +73,7 @@ func TestQueryListBySkuIds(t *testing.T) {
|
||||
2018806493,
|
||||
2018805873,
|
||||
}
|
||||
result, err := jdapi.QueryListBySkuIds(ids, nil)
|
||||
result, err := api.QueryListBySkuIds(ids, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -84,7 +84,7 @@ func TestQueryListBySkuIds(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestQueryKeyWordDicInfo(t *testing.T) {
|
||||
result, totalCount, err := jdapi.QueryKeyWordDicInfo(0, 0, "")
|
||||
result, totalCount, err := api.QueryKeyWordDicInfo(0, 0, "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -95,46 +95,46 @@ func TestQueryKeyWordDicInfo(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSyncProduct(t *testing.T) {
|
||||
result, err := jdapi.SyncProduct("11732425", "2015717812")
|
||||
result, err := api.SyncProduct("11732425", "2015717812")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
baseapi.SugarLogger.Debug(result)
|
||||
result, err = jdapi.SyncProduct("wrongstoreid", "2015717812")
|
||||
result, err = api.SyncProduct("wrongstoreid", "2015717812")
|
||||
if err == nil {
|
||||
t.Fatal("SyncProduct should return error")
|
||||
}
|
||||
result, err = jdapi.SyncProduct("11732425", "wrongskuid")
|
||||
result, err = api.SyncProduct("11732425", "wrongskuid")
|
||||
if err == nil {
|
||||
t.Fatal("SyncProduct should return error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetProductStatust(t *testing.T) {
|
||||
result, err := jdapi.GetProductStatus("11732425", "2015717812")
|
||||
result, err := api.GetProductStatus("11732425", "2015717812")
|
||||
if err != nil || result == nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// baseapi.SugarLogger.Debug(result)
|
||||
result, err = jdapi.GetProductStatus("wrongstoreid", "2015717812")
|
||||
result, err = api.GetProductStatus("wrongstoreid", "2015717812")
|
||||
if err == nil {
|
||||
t.Fatal("GetProductStatus should return error")
|
||||
}
|
||||
result, err = jdapi.GetProductStatus("11732425", "wrongskuid")
|
||||
result, err = api.GetProductStatus("11732425", "wrongskuid")
|
||||
if err == nil {
|
||||
t.Fatal("GetProductStatus should return error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDelShopCategory(t *testing.T) {
|
||||
err := jdapi.DelShopCategory(4784689)
|
||||
err := api.DelShopCategory(4784689)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetSkuSaleAttrName(t *testing.T) {
|
||||
result, err := jdapi.GetSkuSaleAttrName()
|
||||
result, err := api.GetSkuSaleAttrName()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -142,7 +142,7 @@ func TestGetSkuSaleAttrName(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetSpuSaleAttr(t *testing.T) {
|
||||
result, err := jdapi.GetSpuSaleAttr("3628")
|
||||
result, err := api.GetSpuSaleAttr("3628")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -159,7 +159,7 @@ func TestBatchAddSku(t *testing.T) {
|
||||
IsSale: true,
|
||||
},
|
||||
}
|
||||
result, err := jdapi.BatchAddSku(paramList)
|
||||
result, err := api.BatchAddSku(paramList)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -167,7 +167,7 @@ func TestBatchAddSku(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetSpuStatus(t *testing.T) {
|
||||
result, err := jdapi.GetSpuStatus("8515")
|
||||
result, err := api.GetSpuStatus("8515")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -175,7 +175,7 @@ func TestGetSpuStatus(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdateSpuSaleAttr(t *testing.T) {
|
||||
err := jdapi.UpdateSpuSaleAttr("3628", "1001", "", "10", "hello")
|
||||
err := api.UpdateSpuSaleAttr("3628", "1001", "", "10", "hello")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user