MCPcopy Create free account
hub / github.com/docker/cli / TestMatchUnreleasedSignatures

Function TestMatchUnreleasedSignatures

cmd/docker-trust/trust/inspect_pretty_test.go:234–245  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

232}
233
234func TestMatchUnreleasedSignatures(t *testing.T) {
235 // try an "unreleased" target with 3 signatures, 0 rows will appear
236 unreleasedTgts := []notaryclient.TargetSignedStruct{}
237
238 tgt := notaryclient.Target{Name: "unreleased", Hashes: data.Hashes{notary.SHA256: []byte("hash")}}
239 for _, unreleasedRole := range []string{"targets/a", "targets/b", "targets/c"} {
240 unreleasedTgts = append(unreleasedTgts, notaryclient.TargetSignedStruct{Role: mockDelegationRoleWithName(unreleasedRole), Target: tgt})
241 }
242
243 matchedSigRows := matchReleasedSignatures(unreleasedTgts)
244 assert.Check(t, is.Len(matchedSigRows, 0))
245}
246
247func TestMatchOneReleasedSingleSignature(t *testing.T) {
248 // now try only 1 "released" target with no additional sigs, 1 row will appear with 0 signers

Callers

nothing calls this directly

Calls 3

matchReleasedSignaturesFunction · 0.85
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…