Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nvthongswansea committed Jan 14, 2025
1 parent 6d76cf4 commit 0cf1de8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builder/gridscale/artifact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ import (
type TemplateOperatorMock struct{}

func (t TemplateOperatorMock) GetTemplate(ctx context.Context, id string) (gsclient.Template, error) {
panic("implement me")
return gsclient.Template{
Properties: gsclient.TemplateProperties{
Name: "test",
ObjectUUID: "test",
},
}, nil
}

func (t TemplateOperatorMock) GetTemplateByName(ctx context.Context, name string) (gsclient.Template, error) {
Expand Down
12 changes: 12 additions & 0 deletions builder/gridscale/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,18 @@ func (u *uiMock) Ask(s string) (string, error) {
panic("implement me")
}

func (u *uiMock) Askf(string, ...any) (string, error) {
panic("implement me")
}

func (u *uiMock) Say(s string) {
u.sayMessage = s
}

func (u *uiMock) Sayf(s string, s2 ...any) {
u.sayMessage = s
}

func (u *uiMock) Message(s string) {
u.sayMessage = s
}
Expand All @@ -101,6 +109,10 @@ func (u *uiMock) Error(s string) {
u.errorMessage = s
}

func (u *uiMock) Errorf(s string, s2 ...any) {
u.errorMessage = s
}

func (u *uiMock) Machine(s string, s2 ...string) {
panic("implement me")
}
Expand Down

0 comments on commit 0cf1de8

Please sign in to comment.