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

Function TestGetByDigest_NoAttestationsFound

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

GetByDigestMethod · 0.95
NewTestHandlerFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected