mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 06:47:20 +08:00
249 lines
6.6 KiB
Go
249 lines
6.6 KiB
Go
// Code generated by mockery. DO NOT EDIT.
|
|
|
|
package biz
|
|
|
|
import (
|
|
api "github.com/acepanel/panel/pkg/api"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
types "github.com/acepanel/panel/pkg/types"
|
|
)
|
|
|
|
// TemplateRepo is an autogenerated mock type for the TemplateRepo type
|
|
type TemplateRepo struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type TemplateRepo_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *TemplateRepo) EXPECT() *TemplateRepo_Expecter {
|
|
return &TemplateRepo_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Callback provides a mock function with given fields: slug
|
|
func (_m *TemplateRepo) Callback(slug string) error {
|
|
ret := _m.Called(slug)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Callback")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = rf(slug)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// TemplateRepo_Callback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Callback'
|
|
type TemplateRepo_Callback_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Callback is a helper method to define mock.On call
|
|
// - slug string
|
|
func (_e *TemplateRepo_Expecter) Callback(slug interface{}) *TemplateRepo_Callback_Call {
|
|
return &TemplateRepo_Callback_Call{Call: _e.mock.On("Callback", slug)}
|
|
}
|
|
|
|
func (_c *TemplateRepo_Callback_Call) Run(run func(slug string)) *TemplateRepo_Callback_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *TemplateRepo_Callback_Call) Return(_a0 error) *TemplateRepo_Callback_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *TemplateRepo_Callback_Call) RunAndReturn(run func(string) error) *TemplateRepo_Callback_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// CreateCompose provides a mock function with given fields: name, compose, envs, autoFirewall
|
|
func (_m *TemplateRepo) CreateCompose(name string, compose string, envs []types.KV, autoFirewall bool) (string, error) {
|
|
ret := _m.Called(name, compose, envs, autoFirewall)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for CreateCompose")
|
|
}
|
|
|
|
var r0 string
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string, string, []types.KV, bool) (string, error)); ok {
|
|
return rf(name, compose, envs, autoFirewall)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string, string, []types.KV, bool) string); ok {
|
|
r0 = rf(name, compose, envs, autoFirewall)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, []types.KV, bool) error); ok {
|
|
r1 = rf(name, compose, envs, autoFirewall)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// TemplateRepo_CreateCompose_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateCompose'
|
|
type TemplateRepo_CreateCompose_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// CreateCompose is a helper method to define mock.On call
|
|
// - name string
|
|
// - compose string
|
|
// - envs []types.KV
|
|
// - autoFirewall bool
|
|
func (_e *TemplateRepo_Expecter) CreateCompose(name interface{}, compose interface{}, envs interface{}, autoFirewall interface{}) *TemplateRepo_CreateCompose_Call {
|
|
return &TemplateRepo_CreateCompose_Call{Call: _e.mock.On("CreateCompose", name, compose, envs, autoFirewall)}
|
|
}
|
|
|
|
func (_c *TemplateRepo_CreateCompose_Call) Run(run func(name string, compose string, envs []types.KV, autoFirewall bool)) *TemplateRepo_CreateCompose_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string), args[1].(string), args[2].([]types.KV), args[3].(bool))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *TemplateRepo_CreateCompose_Call) Return(_a0 string, _a1 error) *TemplateRepo_CreateCompose_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *TemplateRepo_CreateCompose_Call) RunAndReturn(run func(string, string, []types.KV, bool) (string, error)) *TemplateRepo_CreateCompose_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Get provides a mock function with given fields: slug
|
|
func (_m *TemplateRepo) Get(slug string) (*api.Template, error) {
|
|
ret := _m.Called(slug)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Get")
|
|
}
|
|
|
|
var r0 *api.Template
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (*api.Template, error)); ok {
|
|
return rf(slug)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) *api.Template); ok {
|
|
r0 = rf(slug)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*api.Template)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(slug)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// TemplateRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
|
|
type TemplateRepo_Get_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Get is a helper method to define mock.On call
|
|
// - slug string
|
|
func (_e *TemplateRepo_Expecter) Get(slug interface{}) *TemplateRepo_Get_Call {
|
|
return &TemplateRepo_Get_Call{Call: _e.mock.On("Get", slug)}
|
|
}
|
|
|
|
func (_c *TemplateRepo_Get_Call) Run(run func(slug string)) *TemplateRepo_Get_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *TemplateRepo_Get_Call) Return(_a0 *api.Template, _a1 error) *TemplateRepo_Get_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *TemplateRepo_Get_Call) RunAndReturn(run func(string) (*api.Template, error)) *TemplateRepo_Get_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// List provides a mock function with no fields
|
|
func (_m *TemplateRepo) List() api.Templates {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for List")
|
|
}
|
|
|
|
var r0 api.Templates
|
|
if rf, ok := ret.Get(0).(func() api.Templates); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(api.Templates)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// TemplateRepo_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
|
|
type TemplateRepo_List_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// List is a helper method to define mock.On call
|
|
func (_e *TemplateRepo_Expecter) List() *TemplateRepo_List_Call {
|
|
return &TemplateRepo_List_Call{Call: _e.mock.On("List")}
|
|
}
|
|
|
|
func (_c *TemplateRepo_List_Call) Run(run func()) *TemplateRepo_List_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *TemplateRepo_List_Call) Return(_a0 api.Templates) *TemplateRepo_List_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *TemplateRepo_List_Call) RunAndReturn(run func() api.Templates) *TemplateRepo_List_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewTemplateRepo creates a new instance of TemplateRepo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewTemplateRepo(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *TemplateRepo {
|
|
mock := &TemplateRepo{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|