47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package service
|
|
|
|
import (
|
|
json "github.com/json-iterator/go"
|
|
"github.com/smartystreets/goconvey/convey"
|
|
"gitlink.org.cn/JointCloud/pcm-participant-openi/common"
|
|
"gitlink.org.cn/JointCloud/pcm-participant-openi/model"
|
|
"testing"
|
|
)
|
|
|
|
func TestImage(t *testing.T) {
|
|
convey.Convey("Test Container Service", t, func() {
|
|
common.InitClient()
|
|
|
|
token := "8cff1d2db9171462c02901d086d13221389fd082"
|
|
param := &model.ImageRecommendedParam{
|
|
CloudbrainType: -1,
|
|
Page: 1,
|
|
}
|
|
|
|
convey.Convey("GetImageRecommended", func() {
|
|
images, err := GetImageRecommended(token, param)
|
|
if err != nil {
|
|
return
|
|
}
|
|
ir := model.ImageRecommended{}
|
|
jsir, _ := json.Marshal(ir)
|
|
|
|
js, _ := json.Marshal(images)
|
|
convey.So(err, convey.ShouldBeNil)
|
|
convey.So(images, convey.ShouldNotBeEmpty)
|
|
convey.So(string(js), convey.ShouldEqualJSON, string(jsir))
|
|
})
|
|
|
|
convey.Convey("MyImages", func() {
|
|
images, err := MyImages(token, param)
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
convey.So(err, convey.ShouldBeNil)
|
|
convey.So(images, convey.ShouldNotBeEmpty)
|
|
})
|
|
|
|
})
|
|
}
|