65 lines
1.7 KiB
Go
65 lines
1.7 KiB
Go
package tao_vegetable
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
|
"git.rosy.net.cn/jx-callback/business/partner"
|
|
// _ "git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
|
)
|
|
|
|
func TestGetStoreSkusFullInfo(t *testing.T) {
|
|
skuNameList, err := CurPurchaseHandler.GetStoreSkusFullInfo(jxcontext.AdminCtx, nil, 2, "8967897", nil)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(skuNameList, false))
|
|
t.Log(len(skuNameList))
|
|
}
|
|
|
|
func TestGetStoreSkusBareInfo(t *testing.T) {
|
|
storeSkuList, err := CurPurchaseHandler.GetStoreSkusBareInfo(jxcontext.AdminCtx, "", nil, 2, "2523687", []*partner.StoreSkuInfo{
|
|
&partner.StoreSkuInfo{
|
|
SkuID: 16205,
|
|
},
|
|
//&partner.StoreSkuInfo{
|
|
// SkuID: 1306,
|
|
//},
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err.Error())
|
|
}
|
|
t.Log(utils.Format4Output(storeSkuList, false))
|
|
t.Log(len(storeSkuList))
|
|
}
|
|
|
|
func TestDeleteStoreAllSkus(t *testing.T) {
|
|
err := CurPurchaseHandler.DeleteStoreAllSkus(jxcontext.AdminCtx, nil, 2, "2523687", true)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestDeleteStoreAllCategories(t *testing.T) {
|
|
err := CurPurchaseHandler.DeleteStoreAllCategories(jxcontext.AdminCtx, nil, 2, "2523687", true)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestGetStoreCategory(t *testing.T) {
|
|
_, err := CurPurchaseHandler.GetStoreCategory(jxcontext.AdminCtx, 2, "2523687", "不存在的分类")
|
|
if err == nil {
|
|
t.Fatal("应该找不到这个分类")
|
|
}
|
|
catName := "小月饼"
|
|
cat, err := CurPurchaseHandler.GetStoreCategory(jxcontext.AdminCtx, 2, "2523687", catName)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
} else if cat.Name != catName {
|
|
t.Fatal("没有找到正确的商家分类")
|
|
}
|
|
t.Log(utils.Format4Output(cat, false))
|
|
}
|