MCPcopy Create free account
hub / github.com/RaymondCode/simple-demo / TestFeed

Function TestFeed

test/base_api_test.go:11–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestFeed(t *testing.T) {
12 e := newExpect(t)
13
14 feedResp := e.GET("/douyin/feed/").Expect().Status(http.StatusOK).JSON().Object()
15 feedResp.Value("status_code").Number().Equal(0)
16 feedResp.Value("video_list").Array().Length().Gt(0)
17
18 for _, element := range feedResp.Value("video_list").Array().Iter() {
19 video := element.Object()
20 video.ContainsKey("id")
21 video.ContainsKey("author")
22 video.Value("play_url").String().NotEmpty()
23 video.Value("cover_url").String().NotEmpty()
24 }
25}
26
27func TestUserAction(t *testing.T) {
28 e := newExpect(t)

Callers

nothing calls this directly

Calls 1

newExpectFunction · 0.85

Tested by

no test coverage detected