Skip to content

Commit 19a080d

Browse files
authored
traffic-filter: Fix deleteCmd test (#469)
Small fix to traffic filter deleteCmd test.
1 parent c7041e7 commit 19a080d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cmd/deployment/trafficfilter/delete_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func Test_deleteCmd(t *testing.T) {
3636
{
3737
name: "fails due to empty argument",
3838
args: testutils.Args{
39-
Cmd: showCmd,
39+
Cmd: deleteCmd,
4040
Args: []string{"delete"},
4141
Cfg: testutils.MockCfg{Responses: []mock.Response{
4242
mock.SampleInternalError(),
@@ -49,7 +49,7 @@ func Test_deleteCmd(t *testing.T) {
4949
{
5050
name: "fails due to API error",
5151
args: testutils.Args{
52-
Cmd: showCmd,
52+
Cmd: deleteCmd,
5353
Args: []string{
5454
"delete", "11111111111111111111111111111111",
5555
},
@@ -64,7 +64,7 @@ func Test_deleteCmd(t *testing.T) {
6464
{
6565
name: "succeeds",
6666
args: testutils.Args{
67-
Cmd: showCmd,
67+
Cmd: deleteCmd,
6868
Args: []string{
6969
"delete", "4e974d9476534d35b12fbdcfd0acee0a",
7070
},
@@ -90,7 +90,7 @@ func Test_deleteCmd(t *testing.T) {
9090
{
9191
name: "succeeds with ignore associations",
9292
args: testutils.Args{
93-
Cmd: showCmd,
93+
Cmd: deleteCmd,
9494
Args: []string{
9595
"delete", "4e974d9476534d35b12fbdcfd0acee0a", "--ignore-associations",
9696
},
@@ -118,6 +118,7 @@ func Test_deleteCmd(t *testing.T) {
118118
t.Run(tt.name, func(t *testing.T) {
119119
testutils.RunCmdAssertion(t, tt.args, tt.want)
120120
tt.args.Cmd.ResetFlags()
121+
defer initDeleteFlags()
121122
})
122123
}
123124
}

0 commit comments

Comments
 (0)