Skip to content

Commit 68446c6

Browse files
committed
Added testcase for empty nic-slice
1 parent b301502 commit 68446c6

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

internal/cmd/network-interface/list/list_test.go

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,18 @@ func TestOutputProjectResult(t *testing.T) {
224224
wantErr bool
225225
}{
226226
{
227-
name: "empty",
228-
args: args{},
227+
name: "nil as NIC-slice",
228+
args: args{
229+
outputFormat: print.PrettyOutputFormat,
230+
},
231+
wantErr: false,
232+
},
233+
{
234+
name: "empty NIC-slice",
235+
args: args{
236+
outputFormat: print.PrettyOutputFormat,
237+
nics: []iaas.NIC{},
238+
},
229239
wantErr: false,
230240
},
231241
{
@@ -259,8 +269,18 @@ func TestOutputNetworkResult(t *testing.T) {
259269
wantErr bool
260270
}{
261271
{
262-
name: "empty",
263-
args: args{},
272+
name: "nil as NIC-slice",
273+
args: args{
274+
outputFormat: print.PrettyOutputFormat,
275+
},
276+
wantErr: false,
277+
},
278+
{
279+
name: "empty NIC-slice",
280+
args: args{
281+
outputFormat: print.PrettyOutputFormat,
282+
nics: []iaas.NIC{},
283+
},
264284
wantErr: false,
265285
},
266286
{

0 commit comments

Comments
 (0)