添加mtwmapi.RetailListAll
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func TestRetailCatList(t *testing.T) {
|
||||
result, err := api.RetailCatList(testPoiCode)
|
||||
result, err := api.RetailCatList("7875210")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -25,22 +25,22 @@ func TestRetailCatUpdate(t *testing.T) {
|
||||
}
|
||||
func TestRetailCatDelete(t *testing.T) {
|
||||
var err error
|
||||
err = api.RetailCatDelete(testPoiCode, "", utils.GetUpperUUID())
|
||||
err = api.RetailCatDelete(testPoiCode, "" /*utils.GetUpperUUID()*/, "小月饼111")
|
||||
if err == nil {
|
||||
t.Fatal("should return error that can not find such cat")
|
||||
}
|
||||
uniqueCatName := "一二三四五六七八九十"
|
||||
// uniqueCatName := "1234567890" //fmt.Sprintf("CAT%d", time.Now().Unix())
|
||||
err = api.RetailCatUpdate(testPoiCode, uniqueCatName, &Param4UpdateCat{
|
||||
Sequence: 15,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = api.RetailCatDelete(testPoiCode, "", uniqueCatName)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// uniqueCatName := "一二三四五六七八九十"
|
||||
// // uniqueCatName := "1234567890" //fmt.Sprintf("CAT%d", time.Now().Unix())
|
||||
// err = api.RetailCatUpdate(testPoiCode, uniqueCatName, &Param4UpdateCat{
|
||||
// Sequence: 15,
|
||||
// })
|
||||
// if err != nil {
|
||||
// t.Fatal(err)
|
||||
// }
|
||||
// err = api.RetailCatDelete(testPoiCode, "", uniqueCatName)
|
||||
// if err != nil {
|
||||
// t.Fatal(err)
|
||||
// }
|
||||
}
|
||||
|
||||
func TestRetailList(t *testing.T) {
|
||||
@@ -52,6 +52,19 @@ func TestRetailList(t *testing.T) {
|
||||
t.Fatal("should have items")
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
t.Log(len(result))
|
||||
}
|
||||
|
||||
func TestRetailListAll(t *testing.T) {
|
||||
result, err := api.RetailListAll(testPoiCode)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(result) == 0 {
|
||||
t.Fatal("should have items")
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
t.Log(len(result))
|
||||
}
|
||||
|
||||
func TestRetailGet(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user