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

Function TestGetByDigest_Error

pkg/cmd/attestation/api/client_test.go:150–165  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

148}
149
150func TestGetByDigest_Error(t *testing.T) {
151 fetcher := mockDataGenerator{
152 NumUserAttestations: 5,
153 }
154
155 c := LiveClient{
156 githubAPI: mockAPIClient{
157 OnRESTWithNext: fetcher.OnRESTWithNextError,
158 },
159 logger: io.NewTestHandler(),
160 }
161
162 attestations, err := c.GetByDigest(testFetchParamsWithRepo)
163 require.Error(t, err)
164 require.Nil(t, attestations)
165}
166
167func TestFetchBundleFromAttestations_BundleURL(t *testing.T) {
168 httpClient := &mockHttpClient{}

Callers

nothing calls this directly

Calls 3

GetByDigestMethod · 0.95
NewTestHandlerFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected