get_play_info_test.go 727 字节
package vod

import (
	"github.com/gavv/httpexpect"
	"github.com/onsi/ginkgo"
	"net/http"
)

var _ = ginkgo.Describe("获取播放信息测试", func() {
	ginkgo.Describe("获取播放信息测试", func() {
		ginkgo.Context("", func() {
			ginkgo.It("", func() {
				httpExpect := httpexpect.New(ginkgo.GinkgoT(), server.URL)
				body := map[string]interface{}{
					"videoId": "7be8e50dd65e45d285908bf28c8e94b2",
				}
				httpExpect.POST("/v1/vod/getPlayInfo").
					WithJSON(body).
					WithHeader("x-mmm-appproject", "opportunity").
					Expect().
					Status(http.StatusOK).
					JSON().
					Object().
					ContainsKey("code").ValueEqual("code", 0).
					ContainsKey("msg").ValueEqual("msg", "成功")
			})
		})
	})
})