MCPcopy
hub / github.com/larksuite/cli / stubResponse

Function stubResponse

cmd/event/runtime_test.go:54–63  ·  view source on GitHub ↗
(status int, contentType, body string)

Source from the content-addressed store, hash-verified

52}
53
54func stubResponse(status int, contentType, body string) func(*http.Request) (*http.Response, error) {
55 return func(r *http.Request) (*http.Response, error) {
56 return &http.Response{
57 StatusCode: status,
58 Header: http.Header{"Content-Type": []string{contentType}},
59 Body: io.NopCloser(strings.NewReader(body)),
60 Request: r,
61 }, nil
62 }
63}
64
65func requireCallAPIProblem(t *testing.T, err error, category errs.Category, subtype errs.Subtype) {
66 t.Helper()

Calls

no outgoing calls

Tested by

no test coverage detected