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

Function TestDeleteReleaseHTTPError

pkg/cmd/release/create/http_test.go:97–108  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95}
96
97func TestDeleteReleaseHTTPError(t *testing.T) {
98 reg := &httpmock.Registry{}
99 defer reg.Verify(t)
100 reg.Register(
101 httpmock.REST("DELETE", "releases/123"),
102 httpmock.StatusStringResponse(http.StatusInternalServerError, `{"message":"Internal Server Error"}`),
103 )
104
105 err := deleteRelease(&http.Client{Transport: reg}, "github.com", safeurl.NewImmutableSafeURL("https://api.github.com/releases/123"))
106
107 requireAPIHTTPError(t, err, http.StatusInternalServerError)
108}
109
110func TestTokenHasWorkflowScope(t *testing.T) {
111 tests := []struct {

Callers

nothing calls this directly

Calls 7

VerifyMethod · 0.95
RegisterMethod · 0.95
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
NewImmutableSafeURLFunction · 0.92
requireAPIHTTPErrorFunction · 0.85
deleteReleaseFunction · 0.70

Tested by

no test coverage detected