create_upload_video_test.go 733 字节
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{}{
					"fileName": "test.mp4",
				}
				httpExpect.POST("/v1/vod/createUploadVideos").
					WithJSON(body).
					WithHeader("x-mmm-appproject", "opportunity").
					Expect().
					Status(http.StatusOK).
					JSON().
					Object().
					ContainsKey("code").ValueEqual("code", 0).
					ContainsKey("msg").ValueEqual("msg", "成功")
			})
		})
	})
})