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

Function TestIsReleasedTarget

cmd/docker-trust/trust/inspect_pretty_test.go:207–215  ·  view source on GitHub ↗

check if a role name is "released": either targets/releases or targets TUF roles

(t *testing.T)

Source from the content-addressed store, hash-verified

205
206// check if a role name is "released": either targets/releases or targets TUF roles
207func TestIsReleasedTarget(t *testing.T) {
208 assert.Check(t, isReleasedTarget(trust.ReleasesRole))
209 for _, role := range data.BaseRoles {
210 assert.Check(t, is.Equal(role == data.CanonicalTargetsRole, isReleasedTarget(role)))
211 }
212 assert.Check(t, !isReleasedTarget("targets/not-releases"))
213 assert.Check(t, !isReleasedTarget("random"))
214 assert.Check(t, !isReleasedTarget("targets/releases/subrole"))
215}
216
217// creates a mock delegation with a given name and no keys
218func mockDelegationRoleWithName(name string) data.DelegationRole {

Callers

nothing calls this directly

Calls 1

isReleasedTargetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…