// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" "bnema.dev/ermite/internal/ports" mock "github.com/stretchr/testify/mock" ) // NewPushTreeReader creates a new instance of PushTreeReader. 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 NewPushTreeReader(t interface { mock.TestingT Cleanup(func()) }) *PushTreeReader { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &PushTreeReader{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // PushTreeReader is an autogenerated mock type for the PushTreeReader type type PushTreeReader struct { mock.Mock } type PushTreeReader_Expecter struct { mock *mock.Mock } func (_m *PushTreeReader) EXPECT() *PushTreeReader_Expecter { return &PushTreeReader_Expecter{mock: &_m.Mock} } // FirstDifferentEntry provides a mock function for the type PushTreeReader func (_mock *PushTreeReader) FirstDifferentEntry(ctx context.Context, repo domain.RepoName, objects ports.PushObjects, old domain.ObjectID, new domain.ObjectID) (string, error) { ret := _mock.Called(ctx, repo, objects, old, new) if len(ret) == 0 { panic("no return value specified for FirstDifferentEntry") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, ports.PushObjects, domain.ObjectID, domain.ObjectID) (string, error)); ok { return returnFunc(ctx, repo, objects, old, new) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, ports.PushObjects, domain.ObjectID, domain.ObjectID) string); ok { r0 = returnFunc(ctx, repo, objects, old, new) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, ports.PushObjects, domain.ObjectID, domain.ObjectID) error); ok { r1 = returnFunc(ctx, repo, objects, old, new) } else { r1 = ret.Error(1) } return r0, r1 } // PushTreeReader_FirstDifferentEntry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirstDifferentEntry' type PushTreeReader_FirstDifferentEntry_Call struct { *mock.Call } // FirstDifferentEntry is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - objects ports.PushObjects // - old domain.ObjectID // - new domain.ObjectID func (_e *PushTreeReader_Expecter) FirstDifferentEntry(ctx any, repo any, objects any, old any, new any) *PushTreeReader_FirstDifferentEntry_Call { return &PushTreeReader_FirstDifferentEntry_Call{Call: _e.mock.On("FirstDifferentEntry", ctx, repo, objects, old, new)} } func (_c *PushTreeReader_FirstDifferentEntry_Call) Run(run func(ctx context.Context, repo domain.RepoName, objects ports.PushObjects, old domain.ObjectID, new domain.ObjectID)) *PushTreeReader_FirstDifferentEntry_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 ports.PushObjects if args[2] != nil { arg2 = args[2].(ports.PushObjects) } var arg3 domain.ObjectID if args[3] != nil { arg3 = args[3].(domain.ObjectID) } var arg4 domain.ObjectID if args[4] != nil { arg4 = args[4].(domain.ObjectID) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *PushTreeReader_FirstDifferentEntry_Call) Return(name string, err error) *PushTreeReader_FirstDifferentEntry_Call { _c.Call.Return(name, err) return _c } func (_c *PushTreeReader_FirstDifferentEntry_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, objects ports.PushObjects, old domain.ObjectID, new domain.ObjectID) (string, error)) *PushTreeReader_FirstDifferentEntry_Call { _c.Call.Return(run) return _c } // PushSubtrees provides a mock function for the type PushTreeReader func (_mock *PushTreeReader) PushSubtrees(ctx context.Context, repo domain.RepoName, updates []domain.RefUpdate, objects ports.PushObjects, path string, bounds domain.PushWalkBounds) (domain.PushSubtrees, error) { ret := _mock.Called(ctx, repo, updates, objects, path, bounds) if len(ret) == 0 { panic("no return value specified for PushSubtrees") } var r0 domain.PushSubtrees var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects, string, domain.PushWalkBounds) (domain.PushSubtrees, error)); ok { return returnFunc(ctx, repo, updates, objects, path, bounds) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects, string, domain.PushWalkBounds) domain.PushSubtrees); ok { r0 = returnFunc(ctx, repo, updates, objects, path, bounds) } else { r0 = ret.Get(0).(domain.PushSubtrees) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects, string, domain.PushWalkBounds) error); ok { r1 = returnFunc(ctx, repo, updates, objects, path, bounds) } else { r1 = ret.Error(1) } return r0, r1 } // PushTreeReader_PushSubtrees_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushSubtrees' type PushTreeReader_PushSubtrees_Call struct { *mock.Call } // PushSubtrees is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - updates []domain.RefUpdate // - objects ports.PushObjects // - path string // - bounds domain.PushWalkBounds func (_e *PushTreeReader_Expecter) PushSubtrees(ctx any, repo any, updates any, objects any, path any, bounds any) *PushTreeReader_PushSubtrees_Call { return &PushTreeReader_PushSubtrees_Call{Call: _e.mock.On("PushSubtrees", ctx, repo, updates, objects, path, bounds)} } func (_c *PushTreeReader_PushSubtrees_Call) Run(run func(ctx context.Context, repo domain.RepoName, updates []domain.RefUpdate, objects ports.PushObjects, path string, bounds domain.PushWalkBounds)) *PushTreeReader_PushSubtrees_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 []domain.RefUpdate if args[2] != nil { arg2 = args[2].([]domain.RefUpdate) } var arg3 ports.PushObjects if args[3] != nil { arg3 = args[3].(ports.PushObjects) } var arg4 string if args[4] != nil { arg4 = args[4].(string) } var arg5 domain.PushWalkBounds if args[5] != nil { arg5 = args[5].(domain.PushWalkBounds) } run( arg0, arg1, arg2, arg3, arg4, arg5, ) }) return _c } func (_c *PushTreeReader_PushSubtrees_Call) Return(pushSubtrees domain.PushSubtrees, err error) *PushTreeReader_PushSubtrees_Call { _c.Call.Return(pushSubtrees, err) return _c } func (_c *PushTreeReader_PushSubtrees_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, updates []domain.RefUpdate, objects ports.PushObjects, path string, bounds domain.PushWalkBounds) (domain.PushSubtrees, error)) *PushTreeReader_PushSubtrees_Call { _c.Call.Return(run) return _c }