create_upload_videos_test.go 801 字节
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{}{
					"items": []struct {
						FileName string `json:"fileName"`
					}{{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", "成功")
			})
		})
	})
})