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

Function TestGenerateReleaseNotesHTTPError

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

Source from the content-addressed store, hash-verified

40}
41
42func TestGenerateReleaseNotesHTTPError(t *testing.T) {
43 reg := &httpmock.Registry{}
44 defer reg.Verify(t)
45 reg.Register(
46 httpmock.REST("POST", "repos/OWNER/REPO/releases/generate-notes"),
47 httpmock.StatusStringResponse(http.StatusInternalServerError, `{"message":"Internal Server Error"}`),
48 )
49
50 _, err := generateReleaseNotes(&http.Client{Transport: reg}, ghrepo.New("OWNER", "REPO"), "v1.2.3", "", "")
51
52 requireAPIHTTPError(t, err, http.StatusInternalServerError)
53}
54
55func TestCreateReleaseMissingWorkflowScope(t *testing.T) {
56 reg := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 7

VerifyMethod · 0.95
RegisterMethod · 0.95
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
NewFunction · 0.92
generateReleaseNotesFunction · 0.85
requireAPIHTTPErrorFunction · 0.85

Tested by

no test coverage detected