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

Function TestGetAttestationDetail

pkg/cmd/attestation/inspect/bundle_test.go:38–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36}
37
38func TestGetAttestationDetail(t *testing.T) {
39 bundlePath := test.NormalizeRelativePath("../test/data/sigstore-js-2.1.0-bundle.json")
40
41 attestations, err := verification.GetLocalAttestations(bundlePath)
42 require.Len(t, attestations, 1)
43 require.NoError(t, err)
44
45 attestation := attestations[0]
46 detail, err := getAttestationDetail("", *attestation)
47 require.NoError(t, err)
48
49 require.Equal(t, "sigstore", detail.OrgName)
50 require.Equal(t, "71096353", detail.OrgID)
51 require.Equal(t, "sigstore-js", detail.RepositoryName)
52 require.Equal(t, "495574555", detail.RepositoryID)
53 require.Equal(t, "https://github.com/sigstore/sigstore-js/actions/runs/6014488666/attempts/1", detail.WorkflowID)
54}

Callers

nothing calls this directly

Calls 5

NormalizeRelativePathFunction · 0.92
GetLocalAttestationsFunction · 0.92
getAttestationDetailFunction · 0.85
EqualMethod · 0.80
LenMethod · 0.65

Tested by

no test coverage detected