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

Function TestGetAttestationsMaxRetries

pkg/cmd/attestation/api/client_test.go:424–442  ·  view source on GitHub ↗

test total retries

(t *testing.T)

Source from the content-addressed store, hash-verified

422
423// test total retries
424func TestGetAttestationsMaxRetries(t *testing.T) {
425 getAttestationRetryInterval = 0
426
427 fetcher := mockDataGenerator{
428 NumUserAttestations: 5,
429 }
430
431 c := &LiveClient{
432 githubAPI: mockAPIClient{
433 OnRESTWithNext: fetcher.OnREST500ErrorHandler(),
434 },
435 logger: io.NewTestHandler(),
436 }
437
438 _, err := c.GetByDigest(testFetchParamsWithRepo)
439 require.Error(t, err)
440
441 fetcher.AssertNumberOfCalls(t, "OnREST500Error", 4)
442}

Callers

nothing calls this directly

Calls 4

OnREST500ErrorHandlerMethod · 0.95
GetByDigestMethod · 0.95
NewTestHandlerFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected