- ebai.SkuUploadRTF

This commit is contained in:
gazebo
2019-05-16 17:43:14 +08:00
parent 59ae17f25b
commit 7ae766ce6b
2 changed files with 45 additions and 1 deletions

View File

@@ -49,7 +49,7 @@ func TestSkuGetItemsByCategoryId(t *testing.T) {
func TestSkuList(t *testing.T) {
result, err := api.SkuList(testShopID, map[string]interface{}{
// KeySkuID: 153879464137191,
KeySkuID: 15570439700710601,
// "delete": 1,
})
if err != nil {
@@ -59,6 +59,16 @@ func TestSkuList(t *testing.T) {
}
}
func TestSkuUploadRTF(t *testing.T) {
rtfDetail := BuildRFTFromImgs("https://image.jxc4.com/sijidou.jpg")
t.Log(rtfDetail)
result, err := api.SkuUploadRTF("2", rtfDetail)
if err != nil {
t.Fatal(err)
}
t.Log(result)
}
func TestSkuCreate(t *testing.T) {
result, err := api.SkuCreate(testShopID, 17, map[string]interface{}{
"name": "测试商品",
@@ -83,6 +93,18 @@ func TestSkuCreate(t *testing.T) {
}
}
func TestSkuUpdate(t *testing.T) {
result, err := api.SkuUpdate("2", 15579787500720732, map[string]interface{}{
// "name": "高级商品2015a333约1100g/份",
"rtf": "https://image-star.elemecdn.com/pb/488b65e430305e54acae89f64c24e6d01b",
})
if err != nil {
t.Fatal(err)
} else {
t.Log(utils.Format4Output(result, false))
}
}
func TestSkuDelete(t *testing.T) {
err := api.SkuDelete(testShopID, "153922044227304")
if err != nil {