Files
baseapi/platformapi/ebaiapi/shop_test.go
gazebo 83c0dc3a82 - up.
2018-09-26 22:23:21 +08:00

86 lines
1.6 KiB
Go

package ebaiapi
import (
"testing"
"git.rosy.net.cn/baseapi/utils"
)
func TestShopList(t *testing.T) {
result, err := api.ShopList(SysStatusAll)
if err != nil {
t.Fatal(err)
} else {
t.Log(utils.Format4Output(result, false))
}
}
func TestShopCreate(t *testing.T) {
// result, err := api.ShopCreate("", testShopBaiduID)
// if err != nil {
// t.Fatal(err)
// } else {
// t.Log(utils.Format4Output(result, false))
// }
}
func TestShopGet(t *testing.T) {
result, err := api.ShopGet("", testShopBaiduID)
if err != nil {
t.Fatal(err)
} else {
t.Log(utils.Format4Output(result, false))
}
// result, err = api.ShopGet(testShopID, 0)
// if err != nil {
// t.Fatal(err)
// } else {
// t.Log(utils.Format4Output(result, false))
// }
}
func TestShopUpdate(t *testing.T) {
params := map[string]interface{}{
KeyShopID: testShopID,
KeyName: "hello",
"phone": "13812345678",
}
err := api.ShopUpdate(params)
if err != nil {
t.Fatal(err)
} else {
}
}
func TestShopBusStatusGet(t *testing.T) {
result, err := api.ShopBusStatusGet(testShopID, 0, PlatformFlagBaidu)
if err != nil {
t.Fatal(err)
} else {
t.Log(result)
}
}
func TestShopIDBatchUpdate(t *testing.T) {
err := api.ShopIDBatchUpdate([]string{utils.Int2Str(testShopBaiduID)}, []string{"100077"})
if err != nil {
t.Fatal(err)
}
// err = api.ShopIDBatchUpdate([]string{utils.Int2Str(testShopBaiduID)}, []string{testShopID})
// if err != nil {
// t.Fatal(err)
// }
}
func TestSupplierList(t *testing.T) {
result, err := api.SupplierList()
if err != nil {
t.Fatal(err)
} else {
t.Log(utils.Format4Output(result, false))
}
}