- 添加了部分到家订单级促销

This commit is contained in:
gazebo
2019-04-04 21:03:10 +08:00
parent ef69a4f60d
commit c3e3c32d44
14 changed files with 294 additions and 107 deletions

View File

@@ -14,7 +14,7 @@ const (
)
func TestGetStationsByVenderId(t *testing.T) {
result, err := jdapi.GetStationsByVenderId()
result, err := api.GetStationsByVenderId()
if err != nil {
t.Fatal(err)
}
@@ -31,7 +31,7 @@ func TestGetStationsByVenderId(t *testing.T) {
}
func TestGetStoreInfoByStationNo(t *testing.T) {
result, err := jdapi.GetStoreInfoByStationNo(mustExistStoreID)
result, err := api.GetStoreInfoByStationNo(mustExistStoreID)
if err != nil {
t.Fatal(err)
}
@@ -42,7 +42,7 @@ func TestGetStoreInfoByStationNo(t *testing.T) {
}
func TestUpdateStoreInfo4Open(t *testing.T) {
result, err := jdapi.GetStoreInfoByStationNo(mustExistStoreID)
result, err := api.GetStoreInfoByStationNo(mustExistStoreID)
if err != nil {
t.Fatal(err)
}
@@ -51,12 +51,12 @@ func TestUpdateStoreInfo4Open(t *testing.T) {
addParams := map[string]interface{}{
"stationAddress": testAddress,
}
err = jdapi.UpdateStoreInfo4Open(mustExistStoreID, "test", addParams)
err = api.UpdateStoreInfo4Open(mustExistStoreID, "test", addParams)
if err != nil {
t.Fatal(err)
}
result, err = jdapi.GetStoreInfoByStationNo(mustExistStoreID)
result, err = api.GetStoreInfoByStationNo(mustExistStoreID)
newAddress := result["stationAddress"].(string)
if newAddress != testAddress {
t.Fatalf("address not match, newAddress:%s, oldAddress:%s", newAddress, oldAddress)
@@ -65,7 +65,7 @@ func TestUpdateStoreInfo4Open(t *testing.T) {
addParams = map[string]interface{}{
"stationAddress": oldAddress,
}
jdapi.UpdateStoreInfo4Open(mustExistStoreID, "test", addParams)
api.UpdateStoreInfo4Open(mustExistStoreID, "test", addParams)
if err != nil {
t.Fatal(err)
}
@@ -73,7 +73,7 @@ func TestUpdateStoreInfo4Open(t *testing.T) {
}
func TestGetCommentByOrderId(t *testing.T) {
testOrderID := int64(822347450000922)
result, err := jdapi.GetCommentByOrderId(testOrderID)
result, err := api.GetCommentByOrderId(testOrderID)
if err != nil {
t.Fatal(err.Error())
}
@@ -88,7 +88,7 @@ func TestUpdateStoreConfig4Open(t *testing.T) {
testStationNo := "11785740"
desiredValue := true
// 马上修改了后通过GetStoreInfoByStationNo得到的数据不及时测试不能过的。。。
result, err := jdapi.UpdateStoreConfig4Open(testStationNo, desiredValue)
result, err := api.UpdateStoreConfig4Open(testStationNo, desiredValue)
if err != nil || !result {
if err != nil {
t.Fatal(err.Error())
@@ -96,7 +96,7 @@ func TestUpdateStoreConfig4Open(t *testing.T) {
t.Fatal(result)
}
time.Sleep(2 * time.Second)
result2, err := jdapi.GetStoreInfoByStationNo(testStationNo)
result2, err := api.GetStoreInfoByStationNo(testStationNo)
if err != nil {
t.Fatal(err.Error())
}
@@ -108,11 +108,11 @@ func TestUpdateStoreConfig4Open(t *testing.T) {
func TestGetDeliveryRangeByStationNo(t *testing.T) {
const testStoreID = "11738152"
result, err := jdapi.GetDeliveryRangeByStationNo(testStoreID)
result, err := api.GetDeliveryRangeByStationNo(testStoreID)
if err != nil {
t.Fatal(err)
}
result2, err := jdapi.GetStoreInfoByStationNo(testStoreID)
result2, err := api.GetStoreInfoByStationNo(testStoreID)
if err != nil {
t.Fatal(err)
}
@@ -126,7 +126,7 @@ func TestGetDeliveryRangeByStationNo(t *testing.T) {
"deliveryRangeType": 2,
"coordinatePoints": deliveryRange,
}
err = jdapi.UpdateStoreInfo4Open(testStoreID, "test", params)
err = api.UpdateStoreInfo4Open(testStoreID, "test", params)
if err != nil {
t.Fatal(err)
}