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

Function TestGetByDigest_NoAttestationsFound

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

Source from the content-addressed store, hash-verified

132}
133
134func TestGetByDigest_NoAttestationsFound(t *testing.T) {
135 fetcher := mockDataGenerator{
136 NumUserAttestations: 5,
137 }
138
139 httpClient := &mockHttpClient{}
140 c := LiveClient{
141 githubAPI: mockAPIClient{
142 OnRESTWithNext: fetcher.OnRESTWithNextNoAttestations,
143 },
144 externalHttpClient: httpClient,
145 logger: io.NewTestHandler(),
146 }
147
148 attestations, err := c.GetByDigest(testFetchParamsWithRepo)
149 require.Error(t, err)
150 require.IsType(t, ErrNoAttestationsFound, err)
151 require.Nil(t, attestations)
152}
153
154func TestGetByDigest_Error(t *testing.T) {
155 fetcher := mockDataGenerator{

Callers

nothing calls this directly

Calls 3

GetByDigestMethod · 0.95
NewTestHandlerFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected