MCPcopy Index your code
hub / github.com/cli/cli / TestGetAnnotations404

Function TestGetAnnotations404

pkg/cmd/run/shared/shared_test.go:44–59  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func 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
61func TestRun_Duration(t *testing.T) {
62 now, _ := time.Parse(time.RFC3339, "2022-07-20T11:22:58Z")

Callers

nothing calls this directly

Calls 8

VerifyMethod · 0.95
RegisterMethod · 0.95
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
NewClientFromHTTPFunction · 0.92
NewFunction · 0.92
GetAnnotationsFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected