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

Function TestGetBundle_RequestFail

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

getBundle retries when the HTTP request fails

(t *testing.T)

Source from the content-addressed store, hash-verified

304
305// getBundle retries when the HTTP request fails
306func TestGetBundle_RequestFail(t *testing.T) {
307 mockHTTPClient := &reqFailHttpClient{}
308
309 c := &LiveClient{
310 externalHttpClient: mockHTTPClient,
311 logger: io.NewTestHandler(),
312 }
313
314 b, err := c.getBundle("mybundleurl")
315 require.Error(t, err)
316 require.Nil(t, b)
317 mockHTTPClient.AssertNumberOfCalls(t, "OnGetReqFail", 4)
318}
319
320func TestGetTrustDomain(t *testing.T) {
321 fetcher := mockMetaGenerator{

Callers

nothing calls this directly

Calls 3

getBundleMethod · 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…