mirror of
https://github.com/tnb-labs/panel.git
synced 2026-08-30 17:05:19 +08:00
be938a4814
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
391 lines
10 KiB
Go
391 lines
10 KiB
Go
// Code generated by mockery; DO NOT EDIT.
|
|
// github.com/vektra/mockery
|
|
// template: testify
|
|
|
|
package biz
|
|
|
|
import (
|
|
"github.com/acepanel/panel/v3/internal/biz"
|
|
"github.com/acepanel/panel/v3/pkg/api"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// NewCacheRepo creates a new instance of CacheRepo. 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 NewCacheRepo(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *CacheRepo {
|
|
mock := &CacheRepo{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|
|
|
|
// CacheRepo is an autogenerated mock type for the CacheRepo type
|
|
type CacheRepo struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type CacheRepo_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *CacheRepo) EXPECT() *CacheRepo_Expecter {
|
|
return &CacheRepo_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// FetchApps provides a mock function for the type CacheRepo
|
|
func (_mock *CacheRepo) FetchApps() (*api.Apps, error) {
|
|
ret := _mock.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for FetchApps")
|
|
}
|
|
|
|
var r0 *api.Apps
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func() (*api.Apps, error)); ok {
|
|
return returnFunc()
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func() *api.Apps); ok {
|
|
r0 = returnFunc()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*api.Apps)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func() error); ok {
|
|
r1 = returnFunc()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// CacheRepo_FetchApps_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchApps'
|
|
type CacheRepo_FetchApps_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// FetchApps is a helper method to define mock.On call
|
|
func (_e *CacheRepo_Expecter) FetchApps() *CacheRepo_FetchApps_Call {
|
|
return &CacheRepo_FetchApps_Call{Call: _e.mock.On("FetchApps")}
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchApps_Call) Run(run func()) *CacheRepo_FetchApps_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchApps_Call) Return(apps *api.Apps, err error) *CacheRepo_FetchApps_Call {
|
|
_c.Call.Return(apps, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchApps_Call) RunAndReturn(run func() (*api.Apps, error)) *CacheRepo_FetchApps_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// FetchCategories provides a mock function for the type CacheRepo
|
|
func (_mock *CacheRepo) FetchCategories() (*api.Categories, error) {
|
|
ret := _mock.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for FetchCategories")
|
|
}
|
|
|
|
var r0 *api.Categories
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func() (*api.Categories, error)); ok {
|
|
return returnFunc()
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func() *api.Categories); ok {
|
|
r0 = returnFunc()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*api.Categories)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func() error); ok {
|
|
r1 = returnFunc()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// CacheRepo_FetchCategories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchCategories'
|
|
type CacheRepo_FetchCategories_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// FetchCategories is a helper method to define mock.On call
|
|
func (_e *CacheRepo_Expecter) FetchCategories() *CacheRepo_FetchCategories_Call {
|
|
return &CacheRepo_FetchCategories_Call{Call: _e.mock.On("FetchCategories")}
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchCategories_Call) Run(run func()) *CacheRepo_FetchCategories_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchCategories_Call) Return(categories *api.Categories, err error) *CacheRepo_FetchCategories_Call {
|
|
_c.Call.Return(categories, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchCategories_Call) RunAndReturn(run func() (*api.Categories, error)) *CacheRepo_FetchCategories_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// FetchEnvironments provides a mock function for the type CacheRepo
|
|
func (_mock *CacheRepo) FetchEnvironments() (*api.Environments, error) {
|
|
ret := _mock.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for FetchEnvironments")
|
|
}
|
|
|
|
var r0 *api.Environments
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func() (*api.Environments, error)); ok {
|
|
return returnFunc()
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func() *api.Environments); ok {
|
|
r0 = returnFunc()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*api.Environments)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func() error); ok {
|
|
r1 = returnFunc()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// CacheRepo_FetchEnvironments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchEnvironments'
|
|
type CacheRepo_FetchEnvironments_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// FetchEnvironments is a helper method to define mock.On call
|
|
func (_e *CacheRepo_Expecter) FetchEnvironments() *CacheRepo_FetchEnvironments_Call {
|
|
return &CacheRepo_FetchEnvironments_Call{Call: _e.mock.On("FetchEnvironments")}
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchEnvironments_Call) Run(run func()) *CacheRepo_FetchEnvironments_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchEnvironments_Call) Return(environments *api.Environments, err error) *CacheRepo_FetchEnvironments_Call {
|
|
_c.Call.Return(environments, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchEnvironments_Call) RunAndReturn(run func() (*api.Environments, error)) *CacheRepo_FetchEnvironments_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// FetchTemplates provides a mock function for the type CacheRepo
|
|
func (_mock *CacheRepo) FetchTemplates() (*api.Templates, error) {
|
|
ret := _mock.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for FetchTemplates")
|
|
}
|
|
|
|
var r0 *api.Templates
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func() (*api.Templates, error)); ok {
|
|
return returnFunc()
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func() *api.Templates); ok {
|
|
r0 = returnFunc()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*api.Templates)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func() error); ok {
|
|
r1 = returnFunc()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// CacheRepo_FetchTemplates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchTemplates'
|
|
type CacheRepo_FetchTemplates_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// FetchTemplates is a helper method to define mock.On call
|
|
func (_e *CacheRepo_Expecter) FetchTemplates() *CacheRepo_FetchTemplates_Call {
|
|
return &CacheRepo_FetchTemplates_Call{Call: _e.mock.On("FetchTemplates")}
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchTemplates_Call) Run(run func()) *CacheRepo_FetchTemplates_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchTemplates_Call) Return(templates *api.Templates, err error) *CacheRepo_FetchTemplates_Call {
|
|
_c.Call.Return(templates, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_FetchTemplates_Call) RunAndReturn(run func() (*api.Templates, error)) *CacheRepo_FetchTemplates_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Get provides a mock function for the type CacheRepo
|
|
func (_mock *CacheRepo) Get(key biz.CacheKey, defaultValue ...string) (string, error) {
|
|
var tmpRet mock.Arguments
|
|
if len(defaultValue) > 0 {
|
|
tmpRet = _mock.Called(key, defaultValue)
|
|
} else {
|
|
tmpRet = _mock.Called(key)
|
|
}
|
|
ret := tmpRet
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Get")
|
|
}
|
|
|
|
var r0 string
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(biz.CacheKey, ...string) (string, error)); ok {
|
|
return returnFunc(key, defaultValue...)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(biz.CacheKey, ...string) string); ok {
|
|
r0 = returnFunc(key, defaultValue...)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(biz.CacheKey, ...string) error); ok {
|
|
r1 = returnFunc(key, defaultValue...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// CacheRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
|
|
type CacheRepo_Get_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Get is a helper method to define mock.On call
|
|
// - key biz.CacheKey
|
|
// - defaultValue ...string
|
|
func (_e *CacheRepo_Expecter) Get(key any, defaultValue ...any) *CacheRepo_Get_Call {
|
|
return &CacheRepo_Get_Call{Call: _e.mock.On("Get",
|
|
append([]any{key}, defaultValue...)...)}
|
|
}
|
|
|
|
func (_c *CacheRepo_Get_Call) Run(run func(key biz.CacheKey, defaultValue ...string)) *CacheRepo_Get_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 biz.CacheKey
|
|
if args[0] != nil {
|
|
arg0 = args[0].(biz.CacheKey)
|
|
}
|
|
var arg1 []string
|
|
var variadicArgs []string
|
|
if len(args) > 1 {
|
|
variadicArgs = args[1].([]string)
|
|
}
|
|
arg1 = variadicArgs
|
|
run(
|
|
arg0,
|
|
arg1...,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_Get_Call) Return(s string, err error) *CacheRepo_Get_Call {
|
|
_c.Call.Return(s, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_Get_Call) RunAndReturn(run func(key biz.CacheKey, defaultValue ...string) (string, error)) *CacheRepo_Get_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Set provides a mock function for the type CacheRepo
|
|
func (_mock *CacheRepo) Set(key biz.CacheKey, value string) error {
|
|
ret := _mock.Called(key, value)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Set")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(biz.CacheKey, string) error); ok {
|
|
r0 = returnFunc(key, value)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// CacheRepo_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set'
|
|
type CacheRepo_Set_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Set is a helper method to define mock.On call
|
|
// - key biz.CacheKey
|
|
// - value string
|
|
func (_e *CacheRepo_Expecter) Set(key any, value any) *CacheRepo_Set_Call {
|
|
return &CacheRepo_Set_Call{Call: _e.mock.On("Set", key, value)}
|
|
}
|
|
|
|
func (_c *CacheRepo_Set_Call) Run(run func(key biz.CacheKey, value string)) *CacheRepo_Set_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 biz.CacheKey
|
|
if args[0] != nil {
|
|
arg0 = args[0].(biz.CacheKey)
|
|
}
|
|
var arg1 string
|
|
if args[1] != nil {
|
|
arg1 = args[1].(string)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_Set_Call) Return(err error) *CacheRepo_Set_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *CacheRepo_Set_Call) RunAndReturn(run func(key biz.CacheKey, value string) error) *CacheRepo_Set_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|