1
This commit is contained in:
43
business/partner/purchase/tiktok_store/store_test.go
Normal file
43
business/partner/purchase/tiktok_store/store_test.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package tiktok_store
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
// _ "git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
||||
)
|
||||
|
||||
//func TestReadStore(t *testing.T) {
|
||||
// store, err := CurPurchaseHandler.ReadStore(jxcontext.AdminCtx, "", "4351018")
|
||||
// if err != nil {
|
||||
// t.Fatal(err)
|
||||
// }
|
||||
// t.Log(utils.Format4Output(store, false))
|
||||
//}
|
||||
|
||||
func TestUpdateStore(t *testing.T) {
|
||||
err := CurPurchaseHandler.UpdateStore(nil, 100002, "test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConstrainOpTimeList(t *testing.T) {
|
||||
timeList := constrainOpTimeList([]int16{830, 1800}, []int16{
|
||||
0,
|
||||
200,
|
||||
930,
|
||||
1700,
|
||||
})
|
||||
t.Log(utils.Format4Output(timeList, false))
|
||||
if timeList[0] != 930 || timeList[1] != 1700 {
|
||||
t.Fatal("constrainOpTimeList failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetOpTimeListFromErr(t *testing.T) {
|
||||
err := utils.NewErrorIntCode("当前配送营业时间为:07:00~24:00", mtwmapi.ErrCodeOpFailed)
|
||||
list := getOpTimeListFromErr(err)
|
||||
t.Log(list)
|
||||
}
|
||||
Reference in New Issue
Block a user