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

Function TestGetBundle_RequestFail

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

getBundle retries when the HTTP request fails

(t *testing.T)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

getBundleMethod · 0.95
NewTestHandlerFunction · 0.92
NewImmutableSafeURLFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected