Add mocks

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2025-04-06 16:20:07 +00:00
parent 51c7d2a806
commit d7d6d1e31a
2 changed files with 80 additions and 0 deletions

View file

@ -9,6 +9,8 @@ import (
mock "github.com/stretchr/testify/mock"
params "github.com/cloudbase/garm/params"
url "net/url"
)
// GithubClient is an autogenerated mock type for the GithubClient type
@ -115,6 +117,24 @@ func (_m *GithubClient) DeleteEntityHook(ctx context.Context, id int64) (*github
return r0, r1
}
// GetEntity provides a mock function with given fields:
func (_m *GithubClient) GetEntity() params.GithubEntity {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetEntity")
}
var r0 params.GithubEntity
if rf, ok := ret.Get(0).(func() params.GithubEntity); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(params.GithubEntity)
}
return r0
}
// GetEntityHook provides a mock function with given fields: ctx, id
func (_m *GithubClient) GetEntityHook(ctx context.Context, id int64) (*github.Hook, error) {
ret := _m.Called(ctx, id)
@ -223,6 +243,26 @@ func (_m *GithubClient) GetWorkflowJobByID(ctx context.Context, owner string, re
return r0, r1, r2
}
// GithubBaseURL provides a mock function with given fields:
func (_m *GithubClient) GithubBaseURL() *url.URL {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GithubBaseURL")
}
var r0 *url.URL
if rf, ok := ret.Get(0).(func() *url.URL); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*url.URL)
}
}
return r0
}
// ListEntityHooks provides a mock function with given fields: ctx, opts
func (_m *GithubClient) ListEntityHooks(ctx context.Context, opts *github.ListOptions) ([]*github.Hook, *github.Response, error) {
ret := _m.Called(ctx, opts)

View file

@ -9,6 +9,8 @@ import (
mock "github.com/stretchr/testify/mock"
params "github.com/cloudbase/garm/params"
url "net/url"
)
// GithubEntityOperations is an autogenerated mock type for the GithubEntityOperations type
@ -115,6 +117,24 @@ func (_m *GithubEntityOperations) DeleteEntityHook(ctx context.Context, id int64
return r0, r1
}
// GetEntity provides a mock function with given fields:
func (_m *GithubEntityOperations) GetEntity() params.GithubEntity {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetEntity")
}
var r0 params.GithubEntity
if rf, ok := ret.Get(0).(func() params.GithubEntity); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(params.GithubEntity)
}
return r0
}
// GetEntityHook provides a mock function with given fields: ctx, id
func (_m *GithubEntityOperations) GetEntityHook(ctx context.Context, id int64) (*github.Hook, error) {
ret := _m.Called(ctx, id)
@ -184,6 +204,26 @@ func (_m *GithubEntityOperations) GetEntityJITConfig(ctx context.Context, instan
return r0, r1, r2
}
// GithubBaseURL provides a mock function with given fields:
func (_m *GithubEntityOperations) GithubBaseURL() *url.URL {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GithubBaseURL")
}
var r0 *url.URL
if rf, ok := ret.Get(0).(func() *url.URL); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*url.URL)
}
}
return r0
}
// ListEntityHooks provides a mock function with given fields: ctx, opts
func (_m *GithubEntityOperations) ListEntityHooks(ctx context.Context, opts *github.ListOptions) ([]*github.Hook, *github.Response, error) {
ret := _m.Called(ctx, opts)