diff --git a/_mocks/opencsg.com/csghub-server/builder/store/cache/mock_LfsCache.go b/_mocks/opencsg.com/csghub-server/builder/store/cache/mock_LfsCache.go new file mode 100644 index 000000000..014df9dd7 --- /dev/null +++ b/_mocks/opencsg.com/csghub-server/builder/store/cache/mock_LfsCache.go @@ -0,0 +1,191 @@ +// Code generated by mockery v2.53.5. DO NOT EDIT. + +package cache + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// MockLfsCache is an autogenerated mock type for the LfsCache type +type MockLfsCache struct { + mock.Mock +} + +type MockLfsCache_Expecter struct { + mock *mock.Mock +} + +func (_m *MockLfsCache) EXPECT() *MockLfsCache_Expecter { + return &MockLfsCache_Expecter{mock: &_m.Mock} +} + +// CacheLfsProgress provides a mock function with given fields: ctx, repoID, oid, progress +func (_m *MockLfsCache) CacheLfsProgress(ctx context.Context, repoID int64, oid string, progress int) error { + ret := _m.Called(ctx, repoID, oid, progress) + + if len(ret) == 0 { + panic("no return value specified for CacheLfsProgress") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, int64, string, int) error); ok { + r0 = rf(ctx, repoID, oid, progress) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLfsCache_CacheLfsProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CacheLfsProgress' +type MockLfsCache_CacheLfsProgress_Call struct { + *mock.Call +} + +// CacheLfsProgress is a helper method to define mock.On call +// - ctx context.Context +// - repoID int64 +// - oid string +// - progress int +func (_e *MockLfsCache_Expecter) CacheLfsProgress(ctx interface{}, repoID interface{}, oid interface{}, progress interface{}) *MockLfsCache_CacheLfsProgress_Call { + return &MockLfsCache_CacheLfsProgress_Call{Call: _e.mock.On("CacheLfsProgress", ctx, repoID, oid, progress)} +} + +func (_c *MockLfsCache_CacheLfsProgress_Call) Run(run func(ctx context.Context, repoID int64, oid string, progress int)) *MockLfsCache_CacheLfsProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(string), args[3].(int)) + }) + return _c +} + +func (_c *MockLfsCache_CacheLfsProgress_Call) Return(_a0 error) *MockLfsCache_CacheLfsProgress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLfsCache_CacheLfsProgress_Call) RunAndReturn(run func(context.Context, int64, string, int) error) *MockLfsCache_CacheLfsProgress_Call { + _c.Call.Return(run) + return _c +} + +// DeleteLfsProgress provides a mock function with given fields: ctx, repoID, oid +func (_m *MockLfsCache) DeleteLfsProgress(ctx context.Context, repoID int64, oid string) error { + ret := _m.Called(ctx, repoID, oid) + + if len(ret) == 0 { + panic("no return value specified for DeleteLfsProgress") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, int64, string) error); ok { + r0 = rf(ctx, repoID, oid) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLfsCache_DeleteLfsProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteLfsProgress' +type MockLfsCache_DeleteLfsProgress_Call struct { + *mock.Call +} + +// DeleteLfsProgress is a helper method to define mock.On call +// - ctx context.Context +// - repoID int64 +// - oid string +func (_e *MockLfsCache_Expecter) DeleteLfsProgress(ctx interface{}, repoID interface{}, oid interface{}) *MockLfsCache_DeleteLfsProgress_Call { + return &MockLfsCache_DeleteLfsProgress_Call{Call: _e.mock.On("DeleteLfsProgress", ctx, repoID, oid)} +} + +func (_c *MockLfsCache_DeleteLfsProgress_Call) Run(run func(ctx context.Context, repoID int64, oid string)) *MockLfsCache_DeleteLfsProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(string)) + }) + return _c +} + +func (_c *MockLfsCache_DeleteLfsProgress_Call) Return(_a0 error) *MockLfsCache_DeleteLfsProgress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLfsCache_DeleteLfsProgress_Call) RunAndReturn(run func(context.Context, int64, string) error) *MockLfsCache_DeleteLfsProgress_Call { + _c.Call.Return(run) + return _c +} + +// GetLfsProgress provides a mock function with given fields: ctx, repoID, oid +func (_m *MockLfsCache) GetLfsProgress(ctx context.Context, repoID int64, oid string) (int, error) { + ret := _m.Called(ctx, repoID, oid) + + if len(ret) == 0 { + panic("no return value specified for GetLfsProgress") + } + + var r0 int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, string) (int, error)); ok { + return rf(ctx, repoID, oid) + } + if rf, ok := ret.Get(0).(func(context.Context, int64, string) int); ok { + r0 = rf(ctx, repoID, oid) + } else { + r0 = ret.Get(0).(int) + } + + if rf, ok := ret.Get(1).(func(context.Context, int64, string) error); ok { + r1 = rf(ctx, repoID, oid) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLfsCache_GetLfsProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLfsProgress' +type MockLfsCache_GetLfsProgress_Call struct { + *mock.Call +} + +// GetLfsProgress is a helper method to define mock.On call +// - ctx context.Context +// - repoID int64 +// - oid string +func (_e *MockLfsCache_Expecter) GetLfsProgress(ctx interface{}, repoID interface{}, oid interface{}) *MockLfsCache_GetLfsProgress_Call { + return &MockLfsCache_GetLfsProgress_Call{Call: _e.mock.On("GetLfsProgress", ctx, repoID, oid)} +} + +func (_c *MockLfsCache_GetLfsProgress_Call) Run(run func(ctx context.Context, repoID int64, oid string)) *MockLfsCache_GetLfsProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(string)) + }) + return _c +} + +func (_c *MockLfsCache_GetLfsProgress_Call) Return(_a0 int, _a1 error) *MockLfsCache_GetLfsProgress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLfsCache_GetLfsProgress_Call) RunAndReturn(run func(context.Context, int64, string) (int, error)) *MockLfsCache_GetLfsProgress_Call { + _c.Call.Return(run) + return _c +} + +// NewMockLfsCache creates a new instance of MockLfsCache. 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 NewMockLfsCache(t interface { + mock.TestingT + Cleanup(func()) +}) *MockLfsCache { + mock := &MockLfsCache{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}