MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / RespondWithJSON

Method RespondWithJSON

test/testutil/fakeoctopusserver.go:167–176  ·  view source on GitHub ↗
(jsonBytes []byte)

Source from the content-addressed store, hash-verified

165}
166
167func (r *RequestWrapper) RespondWithJSON(jsonBytes []byte) *RequestWrapper {
168 r.Server.Respond(&http.Response{
169 StatusCode: http.StatusOK,
170 Status: "200 OK",
171 Body: io.NopCloser(bytes.NewReader(jsonBytes)),
172 ContentLength: int64(len(jsonBytes)),
173 Header: make(http.Header),
174 }, nil)
175 return r
176}
177
178func (r *RequestWrapper) ExpectHeader(t *testing.T, name string, value string) *RequestWrapper {
179 assert.Contains(t, r.Request.Header, name)

Callers 3

TestGitRunbookListFunction · 0.80

Calls 1

RespondMethod · 0.80

Tested by 3

TestGitRunbookListFunction · 0.64