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

Function TestRemoveLastSignerWarning

cmd/docker-trust/trust/signer_remove_test.go:106–117  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

104}
105
106func TestRemoveLastSignerWarning(t *testing.T) {
107 cli := test.NewFakeCli(&fakeClient{})
108 ctx := context.Background()
109 cli.SetNotaryClient(notaryfake.GetLoadedNotaryRepository)
110
111 err := removeSigner(ctx, cli, signerRemoveOptions{signer: "alice", repos: []string{"signed-repo"}, forceYes: false})
112 assert.NilError(t, err)
113 assert.Check(t, is.Contains(cli.OutBuffer().String(),
114 "The signer \"alice\" signed the last released version of signed-repo. "+
115 "Removing this signer will make signed-repo unpullable. "+
116 "Are you sure you want to continue? [y/N]"))
117}
118
119func TestIsLastSignerForReleases(t *testing.T) {
120 role := data.Role{}

Callers

nothing calls this directly

Calls 5

SetNotaryClientMethod · 0.95
OutBufferMethod · 0.95
removeSignerFunction · 0.85
ContainsMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…