Skip to content

Commit 0cf1de8

Browse files
fix unit tests
1 parent 6d76cf4 commit 0cf1de8

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

builder/gridscale/artifact_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ import (
1212
type TemplateOperatorMock struct{}
1313

1414
func (t TemplateOperatorMock) GetTemplate(ctx context.Context, id string) (gsclient.Template, error) {
15-
panic("implement me")
15+
return gsclient.Template{
16+
Properties: gsclient.TemplateProperties{
17+
Name: "test",
18+
ObjectUUID: "test",
19+
},
20+
}, nil
1621
}
1722

1823
func (t TemplateOperatorMock) GetTemplateByName(ctx context.Context, name string) (gsclient.Template, error) {

builder/gridscale/common_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,18 @@ func (u *uiMock) Ask(s string) (string, error) {
8989
panic("implement me")
9090
}
9191

92+
func (u *uiMock) Askf(string, ...any) (string, error) {
93+
panic("implement me")
94+
}
95+
9296
func (u *uiMock) Say(s string) {
9397
u.sayMessage = s
9498
}
9599

100+
func (u *uiMock) Sayf(s string, s2 ...any) {
101+
u.sayMessage = s
102+
}
103+
96104
func (u *uiMock) Message(s string) {
97105
u.sayMessage = s
98106
}
@@ -101,6 +109,10 @@ func (u *uiMock) Error(s string) {
101109
u.errorMessage = s
102110
}
103111

112+
func (u *uiMock) Errorf(s string, s2 ...any) {
113+
u.errorMessage = s
114+
}
115+
104116
func (u *uiMock) Machine(s string, s2 ...string) {
105117
panic("implement me")
106118
}

0 commit comments

Comments
 (0)