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

Function TestGetByDigest

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

Source from the content-addressed store, hash-verified

114}
115
116func TestGetByDigest(t *testing.T) {
117 for _, tc := range getByTestCases {
118 t.Run(tc.name, func(t *testing.T) {
119 c := NewClientWithMockGHClient(tc.hasNextPage)
120
121 if tc.limit > 0 {
122 tc.params.Limit = tc.limit
123 }
124 attestations, err := c.GetByDigest(tc.params)
125 require.NoError(t, err)
126
127 require.Equal(t, tc.expectedAttestations, len(attestations))
128 bundle := (attestations)[0].Bundle
129 require.Equal(t, bundle.GetMediaType(), "application/vnd.dev.sigstore.bundle.v0.3+json")
130 })
131 }
132}
133
134func TestGetByDigest_NoAttestationsFound(t *testing.T) {
135 fetcher := mockDataGenerator{

Callers

nothing calls this directly

Calls 4

EqualMethod · 0.80
RunMethod · 0.65
GetByDigestMethod · 0.65

Tested by

no test coverage detected