MCPcopy Create free account
hub / github.com/cli/cli / TestRESTWithNextNoContent

Function TestRESTWithNextNoContent

api/client_test.go:220–234  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

218}
219
220func TestRESTWithNextNoContent(t *testing.T) {
221 reg := &httpmock.Registry{}
222 defer reg.Verify(t)
223 client := newTestClient(reg)
224
225 reg.Register(
226 httpmock.REST(http.MethodDelete, "repos/owner/repo/items/1"),
227 httpmock.StatusStringResponse(http.StatusNoContent, "not JSON"),
228 )
229
230 next, err := client.RESTWithNext("github.com", http.MethodDelete, "repos/owner/repo/items/1", nil, nil)
231
232 require.NoError(t, err)
233 assert.Empty(t, next)
234}
235
236func TestHandleHTTPError_GraphQL502(t *testing.T) {
237 req, err := http.NewRequest("GET", "https://api.github.com/user", nil)

Callers

nothing calls this directly

Calls 7

VerifyMethod · 0.95
RegisterMethod · 0.95
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
newTestClientFunction · 0.85
EmptyMethod · 0.80
RESTWithNextMethod · 0.65

Tested by

no test coverage detected