(t *testing.T)
| 505 | } |
| 506 | |
| 507 | func Test_editRelease_decodeError(t *testing.T) { |
| 508 | reg := &httpmock.Registry{} |
| 509 | defer reg.Verify(t) |
| 510 | reg.Register( |
| 511 | func(req *http.Request) bool { |
| 512 | return req.Method == http.MethodPatch && |
| 513 | req.URL.EscapedPath() == "/repos/OWNER/REPO/releases/12345" && |
| 514 | req.URL.Host == "api.github.com" |
| 515 | }, |
| 516 | httpmock.StatusStringResponse(200, `{`), |
| 517 | ) |
| 518 | |
| 519 | httpClient := &http.Client{Transport: reg} |
| 520 | release, err := editRelease(httpClient, ghrepo.New("OWNER", "REPO"), 12345, map[string]any{"tag_name": "v1.2.3"}) |
| 521 | |
| 522 | require.Error(t, err) |
| 523 | assert.NotNil(t, release) // decode was attempted - non-nil pointer even on decode error |
| 524 | } |
| 525 | |
| 526 | func Test_editRelease_204(t *testing.T) { |
| 527 | reg := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected