55 "io"
66 "testing"
77
8- "github.com/docker/cli/cli/command"
98 "github.com/docker/cli/cli/trust"
109 "github.com/docker/cli/internal/test"
1110 "github.com/docker/cli/internal/test/notary"
@@ -58,6 +57,8 @@ func TestTrustRevokeCommandErrors(t *testing.T) {
5857}
5958
6059func TestTrustRevokeCommand (t * testing.T ) {
60+ revokeCancelledError := "`trust revoke` has been cancelled"
61+
6162 testCases := []struct {
6263 doc string
6364 notaryRepository func (trust.ImageRefAndAuth , []string ) (client.Repository , error )
@@ -70,7 +71,7 @@ func TestTrustRevokeCommand(t *testing.T) {
7071 notaryRepository : notary .GetOfflineNotaryRepository ,
7172 args : []string {"reg-name.io/image" },
7273 expectedMessage : "Please confirm you would like to delete all signature data for reg-name.io/image? [y/N] " ,
73- expectedErr : command . ErrUserCancelledOperation . Error () ,
74+ expectedErr : revokeCancelledError ,
7475 },
7576 {
7677 doc : "OfflineErrors_Offline" ,
@@ -89,7 +90,7 @@ func TestTrustRevokeCommand(t *testing.T) {
8990 notaryRepository : notary .GetUninitializedNotaryRepository ,
9091 args : []string {"reg-name.io/image" },
9192 expectedMessage : "Please confirm you would like to delete all signature data for reg-name.io/image? [y/N] " ,
92- expectedErr : command . ErrUserCancelledOperation . Error () ,
93+ expectedErr : revokeCancelledError ,
9394 },
9495 {
9596 doc : "UninitializedErrors_NoTrustData" ,
@@ -108,7 +109,7 @@ func TestTrustRevokeCommand(t *testing.T) {
108109 notaryRepository : notary .GetEmptyTargetsNotaryRepository ,
109110 args : []string {"reg-name.io/image" },
110111 expectedMessage : "Please confirm you would like to delete all signature data for reg-name.io/image? [y/N] " ,
111- expectedErr : command . ErrUserCancelledOperation . Error () ,
112+ expectedErr : revokeCancelledError ,
112113 },
113114 {
114115 doc : "EmptyNotaryRepo_NoSignedTags" ,
@@ -127,7 +128,7 @@ func TestTrustRevokeCommand(t *testing.T) {
127128 notaryRepository : notary .GetEmptyTargetsNotaryRepository ,
128129 args : []string {"alpine" },
129130 expectedMessage : "Please confirm you would like to delete all signature data for alpine? [y/N] " ,
130- expectedErr : command . ErrUserCancelledOperation . Error () ,
131+ expectedErr : revokeCancelledError ,
131132 },
132133 }
133134
0 commit comments