- 新同步逻辑调整,京东还有问题

This commit is contained in:
gazebo
2019-07-18 09:11:31 +08:00
parent b5b3d82130
commit 2c2659b0ed
10 changed files with 98 additions and 59 deletions

View File

@@ -13,7 +13,7 @@ func TestSyncStoresSkus(t *testing.T) {
for i := 0; i < 100; i++ {
skus[i] = i + 1
}
_, err := new(PurchaseHandler).SyncStoreSkus(jxcontext.AdminCtx, nil, testShopID, skus, false, false)
_, err := CurPurchaseHandler.SyncStoreSkus(jxcontext.AdminCtx, nil, testShopID, skus, false, false)
if err != nil {
t.Fatal(err.Error())
}
@@ -22,21 +22,21 @@ func TestSyncStoresSkus(t *testing.T) {
func TestSyncOneStoreCategoriesFromRemote2Local(t *testing.T) {
db := dao.GetDB()
err := new(PurchaseHandler).SyncLocalStoreCategory(db, testShopID, "autotest")
err := CurPurchaseHandler.SyncLocalStoreCategory(db, testShopID, "autotest")
if err != nil {
t.Fatal(err.Error())
}
}
func TestSyncOneStoreCategoriesFromLocal2Remote(t *testing.T) {
_, err := new(PurchaseHandler).SyncStoreCategory(jxcontext.AdminCtx, nil, testShopID, false)
_, err := CurPurchaseHandler.SyncStoreCategory(jxcontext.AdminCtx, nil, testShopID, false)
if err != nil {
t.Fatal(err.Error())
}
}
func TestGetAllRemoteSkus(t *testing.T) {
result, err := new(PurchaseHandler).GetAllRemoteSkus(jxcontext.AdminCtx, testShopID, nil)
result, err := CurPurchaseHandler.GetStoreSkusFullInfo(jxcontext.AdminCtx, nil, testShopID, testShopBaiduID, nil)
if err != nil {
t.Fatal(err.Error())
} else {
@@ -45,14 +45,14 @@ func TestGetAllRemoteSkus(t *testing.T) {
}
func TestDeleteRemoteSkus(t *testing.T) {
err := new(PurchaseHandler).DeleteRemoteSkus(jxcontext.AdminCtx, nil, testShopID, nil)
err := CurPurchaseHandler.DeleteStoreAllSkus(jxcontext.AdminCtx, nil, testShopID, testShopBaiduID, true)
if err != nil {
t.Fatal(err.Error())
}
}
func TestDeleteRemoteCategories(t *testing.T) {
err := new(PurchaseHandler).DeleteRemoteCategories(jxcontext.AdminCtx, nil, testShopID, nil)
err := new(PurchaseHandler).DeleteStoreAllCategories(jxcontext.AdminCtx, nil, testShopID, testShopBaiduID, true)
if err != nil {
t.Fatal(err.Error())
}