Skip to content

Commit b094259

Browse files
committed
added testcase
1 parent e3c417e commit b094259

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

internal/cmd/image/describe/describe_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"testing"
66

77
"github.com/stackitcloud/stackit-cli/internal/pkg/types"
8+
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
89

910
"github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
1011
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
@@ -225,6 +226,33 @@ func TestOutputResult(t *testing.T) {
225226
args: args{},
226227
wantErr: true,
227228
},
229+
{
230+
name: "valid value",
231+
args: args{
232+
resp: &iaas.Image{
233+
Id: utils.Ptr(uuid.NewString()),
234+
Name: utils.Ptr("Image"),
235+
Status: utils.Ptr("STATUS"),
236+
DiskFormat: utils.Ptr("format"),
237+
MinDiskSize: utils.Ptr(int64(0)),
238+
MinRam: utils.Ptr(int64(0)),
239+
Config: &iaas.ImageConfig{
240+
Architecture: utils.Ptr("architecture"),
241+
OperatingSystem: utils.Ptr("os"),
242+
OperatingSystemDistro: iaas.NewNullableString(utils.Ptr("os distro")),
243+
OperatingSystemVersion: iaas.NewNullableString(utils.Ptr("0.00.0")),
244+
Uefi: utils.Ptr(true),
245+
},
246+
Labels: utils.Ptr(map[string]any{
247+
"label1": true,
248+
"label2": false,
249+
"label3": 42,
250+
"foo": "bar",
251+
}),
252+
},
253+
},
254+
wantErr: false,
255+
},
228256
}
229257
p := print.NewPrinter()
230258
p.Cmd = NewCmd(&types.CmdParams{Printer: p})

0 commit comments

Comments
 (0)