- 修复之前将老平台同步逻辑注释掉引入的BUG

This commit is contained in:
gazebo
2019-08-14 00:20:35 +08:00
parent 18ad339e0c
commit 03e23ca0fd
7 changed files with 111 additions and 118 deletions

View File

@@ -2,38 +2,36 @@ package ebai
import (
"testing"
"time"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"git.rosy.net.cn/jx-callback/business/model/dao"
)
func TestSyncStoresSkus(t *testing.T) {
skus := make([]int, 100)
for i := 0; i < 100; i++ {
skus[i] = i + 1
}
_, err := CurPurchaseHandler.SyncStoreSkus(jxcontext.AdminCtx, nil, testShopID, skus, false, false)
if err != nil {
t.Fatal(err.Error())
}
time.Sleep(4 * time.Second)
}
// func TestSyncStoresSkus(t *testing.T) {
// skus := make([]int, 100)
// for i := 0; i < 100; i++ {
// skus[i] = i + 1
// }
// _, err := CurPurchaseHandler.SyncStoreSkus(jxcontext.AdminCtx, nil, testShopID, skus, false, false)
// if err != nil {
// t.Fatal(err.Error())
// }
// time.Sleep(4 * time.Second)
// }
func TestSyncOneStoreCategoriesFromRemote2Local(t *testing.T) {
db := dao.GetDB()
err := CurPurchaseHandler.SyncLocalStoreCategory(db, testShopID, "autotest")
if err != nil {
t.Fatal(err.Error())
}
}
// func TestSyncOneStoreCategoriesFromRemote2Local(t *testing.T) {
// db := dao.GetDB()
// err := CurPurchaseHandler.SyncLocalStoreCategory(db, testShopID, "autotest")
// if err != nil {
// t.Fatal(err.Error())
// }
// }
func TestSyncOneStoreCategoriesFromLocal2Remote(t *testing.T) {
_, err := CurPurchaseHandler.SyncStoreCategory(jxcontext.AdminCtx, nil, testShopID, false)
if err != nil {
t.Fatal(err.Error())
}
}
// func TestSyncOneStoreCategoriesFromLocal2Remote(t *testing.T) {
// _, err := CurPurchaseHandler.SyncStoreCategory(jxcontext.AdminCtx, nil, testShopID, false)
// if err != nil {
// t.Fatal(err.Error())
// }
// }
func TestGetAllRemoteSkus(t *testing.T) {
result, err := CurPurchaseHandler.GetStoreSkusFullInfo(jxcontext.AdminCtx, nil, testShopID, testShopBaiduID, nil)