(t *testing.T)
| 42 | } |
| 43 | |
| 44 | func TestGetAnnotations404(t *testing.T) { |
| 45 | reg := &httpmock.Registry{} |
| 46 | defer reg.Verify(t) |
| 47 | |
| 48 | reg.Register( |
| 49 | httpmock.REST("GET", "repos/OWNER/REPO/check-runs/123456/annotations"), |
| 50 | httpmock.StatusStringResponse(404, "not found")) |
| 51 | |
| 52 | httpClient := &http.Client{Transport: reg} |
| 53 | apiClient := api.NewClientFromHTTP(httpClient) |
| 54 | repo := ghrepo.New("OWNER", "REPO") |
| 55 | |
| 56 | result, err := GetAnnotations(apiClient, repo, Job{ID: 123456, Name: "a job"}) |
| 57 | assert.NoError(t, err) |
| 58 | assert.Equal(t, result, []Annotation{}) |
| 59 | } |
| 60 | |
| 61 | func TestRun_Duration(t *testing.T) { |
| 62 | now, _ := time.Parse(time.RFC3339, "2022-07-20T11:22:58Z") |
nothing calls this directly
no test coverage detected