mirror of https://github.com/docker/cli.git
Fix tests and nit
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
This commit is contained in:
parent
448082f333
commit
5ebb7a65ab
|
@ -46,12 +46,10 @@ func removeSigner(cli command.Cli, options signerRemoveOptions) error {
|
|||
if didRemove, err := removeSingleSigner(cli, repo, options.signer, options.forceYes); err != nil {
|
||||
fmt.Fprintln(cli.Err(), err.Error()+"\n")
|
||||
errRepos = append(errRepos, repo)
|
||||
} else {
|
||||
if didRemove {
|
||||
} else if didRemove {
|
||||
fmt.Fprintf(cli.Out(), "Successfully removed %s from %s\n\n", options.signer, repo)
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(errRepos) > 0 {
|
||||
return fmt.Errorf("Error removing signer from: %s", strings.Join(errRepos, ", "))
|
||||
}
|
||||
|
|
|
@ -71,10 +71,13 @@ func TestTrustSignerRemoveErrors(t *testing.T) {
|
|||
func TestRemoveSingleSigner(t *testing.T) {
|
||||
cli := test.NewFakeCli(&fakeClient{})
|
||||
cli.SetNotaryClient(notaryfake.GetLoadedNotaryRepository)
|
||||
_, err := removeSingleSigner(cli, "signed-repo", "test", true)
|
||||
didRemove, err := removeSingleSigner(cli, "signed-repo", "test", true)
|
||||
assert.Error(t, err, "No signer test for repository signed-repo")
|
||||
assert.Equal(t, didRemove, false, "No signer should be removed")
|
||||
|
||||
_, err = removeSingleSigner(cli, "signed-repo", "releases", true)
|
||||
assert.Error(t, err, "releases is a reserved keyword and cannot be removed")
|
||||
assert.Equal(t, didRemove, false, "No signer should be removed")
|
||||
}
|
||||
|
||||
func TestRemoveMultipleSigners(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue