MCPcopy
hub / github.com/cli/cli / listResp

Function listResp

pkg/cmd/discussion/client/client_test.go:70–88  ·  view source on GitHub ↗

listResp builds a mock repository.discussions JSON response.

(hasNext bool, endCursor string, total int, nodes string)

Source from the content-addressed store, hash-verified

68
69// listResp builds a mock repository.discussions JSON response.
70func listResp(hasNext bool, endCursor string, total int, nodes string) string {
71 return heredoc.Docf(`
72 {
73 "data": {
74 "repository": {
75 "hasDiscussionsEnabled": true,
76 "discussions": {
77 "totalCount": %d,
78 "pageInfo": {
79 "hasNextPage": %t,
80 "endCursor": %q
81 },
82 "nodes": [%s]
83 }
84 }
85 }
86 }
87 `, total, hasNext, endCursor, nodes)
88}
89
90// searchResp builds a mock search JSON response.
91func searchResp(hasNext bool, endCursor string, count int, nodes string) string {

Callers 1

TestListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected