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

Function TestRESTGetDelete

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

Source from the content-addressed store, hash-verified

77}
78
79func TestRESTGetDelete(t *testing.T) {
80 http := &httpmock.Registry{}
81 client := newTestClient(http)
82
83 http.Register(
84 httpmock.REST("DELETE", "applications/CLIENTID/grant"),
85 httpmock.StatusStringResponse(204, "{}"),
86 )
87
88 r := bytes.NewReader([]byte(`{}`))
89 err := client.REST("github.com", "DELETE", "applications/CLIENTID/grant", r, nil)
90 assert.NoError(t, err)
91}
92
93func TestRESTWithFullURL(t *testing.T) {
94 http := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 5

RegisterMethod · 0.95
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
newTestClientFunction · 0.85
RESTMethod · 0.65

Tested by

no test coverage detected