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

Function TestGetAttestationsMaxRetries

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

test total retries

(t *testing.T)

Source from the content-addressed store, hash-verified

380
381// test total retries
382func TestGetAttestationsMaxRetries(t *testing.T) {
383 getAttestationRetryInterval = 0
384
385 fetcher := mockDataGenerator{
386 NumUserAttestations: 5,
387 }
388
389 c := &LiveClient{
390 githubAPI: mockAPIClient{
391 OnRESTWithNext: fetcher.OnREST500ErrorHandler(),
392 },
393 logger: io.NewTestHandler(),
394 }
395
396 _, err := c.GetByDigest(testFetchParamsWithRepo)
397 require.Error(t, err)
398
399 fetcher.AssertNumberOfCalls(t, "OnREST500Error", 4)
400}

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…