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

Function TestGetByDigest_Error

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

GetByDigestMethod · 0.95
NewTestHandlerFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected