mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 04:22:33 +08:00
chore: update mocks
This commit is contained in:
committed by
github-actions[bot]
parent
5018ffa82e
commit
5fd50feab4
@@ -8,6 +8,8 @@ import (
|
||||
biz "github.com/acepanel/panel/internal/biz"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
types "github.com/acepanel/panel/pkg/types"
|
||||
)
|
||||
|
||||
// BackupRepo is an autogenerated mock type for the BackupRepo type
|
||||
@@ -261,17 +263,17 @@ func (_c *BackupRepo_CutoffLog_Call) RunAndReturn(run func(string, string) error
|
||||
return _c
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: ctx, id
|
||||
func (_m *BackupRepo) Delete(ctx context.Context, id uint) error {
|
||||
ret := _m.Called(ctx, id)
|
||||
// Delete provides a mock function with given fields: ctx, typ, name
|
||||
func (_m *BackupRepo) Delete(ctx context.Context, typ biz.BackupType, name string) error {
|
||||
ret := _m.Called(ctx, typ, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, uint) error); ok {
|
||||
r0 = rf(ctx, id)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, biz.BackupType, string) error); ok {
|
||||
r0 = rf(ctx, typ, name)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -286,14 +288,15 @@ type BackupRepo_Delete_Call struct {
|
||||
|
||||
// Delete is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - id uint
|
||||
func (_e *BackupRepo_Expecter) Delete(ctx interface{}, id interface{}) *BackupRepo_Delete_Call {
|
||||
return &BackupRepo_Delete_Call{Call: _e.mock.On("Delete", ctx, id)}
|
||||
// - typ biz.BackupType
|
||||
// - name string
|
||||
func (_e *BackupRepo_Expecter) Delete(ctx interface{}, typ interface{}, name interface{}) *BackupRepo_Delete_Call {
|
||||
return &BackupRepo_Delete_Call{Call: _e.mock.On("Delete", ctx, typ, name)}
|
||||
}
|
||||
|
||||
func (_c *BackupRepo_Delete_Call) Run(run func(ctx context.Context, id uint)) *BackupRepo_Delete_Call {
|
||||
func (_c *BackupRepo_Delete_Call) Run(run func(ctx context.Context, typ biz.BackupType, name string)) *BackupRepo_Delete_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(uint))
|
||||
run(args[0].(context.Context), args[1].(biz.BackupType), args[2].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
@@ -303,7 +306,7 @@ func (_c *BackupRepo_Delete_Call) Return(_a0 error) *BackupRepo_Delete_Call {
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *BackupRepo_Delete_Call) RunAndReturn(run func(context.Context, uint) error) *BackupRepo_Delete_Call {
|
||||
func (_c *BackupRepo_Delete_Call) RunAndReturn(run func(context.Context, biz.BackupType, string) error) *BackupRepo_Delete_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
@@ -399,41 +402,34 @@ func (_c *BackupRepo_GetDefaultPath_Call) RunAndReturn(run func(biz.BackupType)
|
||||
return _c
|
||||
}
|
||||
|
||||
// List provides a mock function with given fields: page, limit, typ
|
||||
func (_m *BackupRepo) List(page uint, limit uint, typ biz.BackupType) ([]*biz.Backup, int64, error) {
|
||||
ret := _m.Called(page, limit, typ)
|
||||
// List provides a mock function with given fields: typ
|
||||
func (_m *BackupRepo) List(typ biz.BackupType) ([]*types.BackupFile, error) {
|
||||
ret := _m.Called(typ)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for List")
|
||||
}
|
||||
|
||||
var r0 []*biz.Backup
|
||||
var r1 int64
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(uint, uint, biz.BackupType) ([]*biz.Backup, int64, error)); ok {
|
||||
return rf(page, limit, typ)
|
||||
var r0 []*types.BackupFile
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(biz.BackupType) ([]*types.BackupFile, error)); ok {
|
||||
return rf(typ)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(uint, uint, biz.BackupType) []*biz.Backup); ok {
|
||||
r0 = rf(page, limit, typ)
|
||||
if rf, ok := ret.Get(0).(func(biz.BackupType) []*types.BackupFile); ok {
|
||||
r0 = rf(typ)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*biz.Backup)
|
||||
r0 = ret.Get(0).([]*types.BackupFile)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(uint, uint, biz.BackupType) int64); ok {
|
||||
r1 = rf(page, limit, typ)
|
||||
if rf, ok := ret.Get(1).(func(biz.BackupType) error); ok {
|
||||
r1 = rf(typ)
|
||||
} else {
|
||||
r1 = ret.Get(1).(int64)
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(uint, uint, biz.BackupType) error); ok {
|
||||
r2 = rf(page, limit, typ)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// BackupRepo_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
|
||||
@@ -442,41 +438,39 @@ type BackupRepo_List_Call struct {
|
||||
}
|
||||
|
||||
// List is a helper method to define mock.On call
|
||||
// - page uint
|
||||
// - limit uint
|
||||
// - typ biz.BackupType
|
||||
func (_e *BackupRepo_Expecter) List(page interface{}, limit interface{}, typ interface{}) *BackupRepo_List_Call {
|
||||
return &BackupRepo_List_Call{Call: _e.mock.On("List", page, limit, typ)}
|
||||
func (_e *BackupRepo_Expecter) List(typ interface{}) *BackupRepo_List_Call {
|
||||
return &BackupRepo_List_Call{Call: _e.mock.On("List", typ)}
|
||||
}
|
||||
|
||||
func (_c *BackupRepo_List_Call) Run(run func(page uint, limit uint, typ biz.BackupType)) *BackupRepo_List_Call {
|
||||
func (_c *BackupRepo_List_Call) Run(run func(typ biz.BackupType)) *BackupRepo_List_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(uint), args[1].(uint), args[2].(biz.BackupType))
|
||||
run(args[0].(biz.BackupType))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *BackupRepo_List_Call) Return(_a0 []*biz.Backup, _a1 int64, _a2 error) *BackupRepo_List_Call {
|
||||
_c.Call.Return(_a0, _a1, _a2)
|
||||
func (_c *BackupRepo_List_Call) Return(_a0 []*types.BackupFile, _a1 error) *BackupRepo_List_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *BackupRepo_List_Call) RunAndReturn(run func(uint, uint, biz.BackupType) ([]*biz.Backup, int64, error)) *BackupRepo_List_Call {
|
||||
func (_c *BackupRepo_List_Call) RunAndReturn(run func(biz.BackupType) ([]*types.BackupFile, error)) *BackupRepo_List_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Restore provides a mock function with given fields: ctx, id, target
|
||||
func (_m *BackupRepo) Restore(ctx context.Context, id uint, target string) error {
|
||||
ret := _m.Called(ctx, id, target)
|
||||
// Restore provides a mock function with given fields: ctx, typ, backup, target
|
||||
func (_m *BackupRepo) Restore(ctx context.Context, typ biz.BackupType, backup string, target string) error {
|
||||
ret := _m.Called(ctx, typ, backup, target)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Restore")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, uint, string) error); ok {
|
||||
r0 = rf(ctx, id, target)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, biz.BackupType, string, string) error); ok {
|
||||
r0 = rf(ctx, typ, backup, target)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -491,15 +485,16 @@ type BackupRepo_Restore_Call struct {
|
||||
|
||||
// Restore is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - id uint
|
||||
// - typ biz.BackupType
|
||||
// - backup string
|
||||
// - target string
|
||||
func (_e *BackupRepo_Expecter) Restore(ctx interface{}, id interface{}, target interface{}) *BackupRepo_Restore_Call {
|
||||
return &BackupRepo_Restore_Call{Call: _e.mock.On("Restore", ctx, id, target)}
|
||||
func (_e *BackupRepo_Expecter) Restore(ctx interface{}, typ interface{}, backup interface{}, target interface{}) *BackupRepo_Restore_Call {
|
||||
return &BackupRepo_Restore_Call{Call: _e.mock.On("Restore", ctx, typ, backup, target)}
|
||||
}
|
||||
|
||||
func (_c *BackupRepo_Restore_Call) Run(run func(ctx context.Context, id uint, target string)) *BackupRepo_Restore_Call {
|
||||
func (_c *BackupRepo_Restore_Call) Run(run func(ctx context.Context, typ biz.BackupType, backup string, target string)) *BackupRepo_Restore_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(uint), args[2].(string))
|
||||
run(args[0].(context.Context), args[1].(biz.BackupType), args[2].(string), args[3].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
@@ -509,7 +504,7 @@ func (_c *BackupRepo_Restore_Call) Return(_a0 error) *BackupRepo_Restore_Call {
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *BackupRepo_Restore_Call) RunAndReturn(run func(context.Context, uint, string) error) *BackupRepo_Restore_Call {
|
||||
func (_c *BackupRepo_Restore_Call) RunAndReturn(run func(context.Context, biz.BackupType, string, string) error) *BackupRepo_Restore_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user