MCPcopy
hub / github.com/cli/cli / TestRESTGetDelete

Function TestRESTGetDelete

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

Source from the content-addressed store, hash-verified

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