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

Function TestPublishReleaseHTTPError

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

Source from the content-addressed store, hash-verified

82}
83
84func TestPublishReleaseHTTPError(t *testing.T) {
85 reg := &httpmock.Registry{}
86 defer reg.Verify(t)
87 reg.Register(
88 httpmock.REST("PATCH", "releases/123"),
89 httpmock.StatusStringResponse(http.StatusInternalServerError, `{"message":"Internal Server Error"}`),
90 )
91
92 _, err := publishRelease(&http.Client{Transport: reg}, "github.com", safeurl.NewImmutableSafeURL("https://api.github.com/releases/123"), "", nil)
93
94 requireAPIHTTPError(t, err, http.StatusInternalServerError)
95}
96
97func TestDeleteReleaseHTTPError(t *testing.T) {
98 reg := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 7

VerifyMethod · 0.95
RegisterMethod · 0.95
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
NewImmutableSafeURLFunction · 0.92
publishReleaseFunction · 0.85
requireAPIHTTPErrorFunction · 0.85

Tested by

no test coverage detected