get_video_play_auth_test.go 732 字节
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/getVideoPlayAuth").
					WithJSON(body).
					WithHeader("x-mmm-appproject", "opportunity").
					Expect().
					Status(http.StatusOK).
					JSON().
					Object().
					ContainsKey("code").ValueEqual("code", 0).
					ContainsKey("msg").ValueEqual("msg", "成功")
			})
		})
	})
})