// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "io" "bnema.dev/ermite/internal/domain" "bnema.dev/ermite/internal/ports" mock "github.com/stretchr/testify/mock" ) // NewRepoReader creates a new instance of RepoReader. 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 NewRepoReader(t interface { mock.TestingT Cleanup(func()) }) *RepoReader { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &RepoReader{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // RepoReader is an autogenerated mock type for the RepoReader type type RepoReader struct { mock.Mock } type RepoReader_Expecter struct { mock *mock.Mock } func (_m *RepoReader) EXPECT() *RepoReader_Expecter { return &RepoReader_Expecter{mock: &_m.Mock} } // GetCommit provides a mock function for the type RepoReader func (_mock *RepoReader) GetCommit(ctx context.Context, repo domain.RepoName, rev domain.Revision, limits domain.DiffLimits) (domain.CommitDetail, error) { ret := _mock.Called(ctx, repo, rev, limits) if len(ret) == 0 { panic("no return value specified for GetCommit") } var r0 domain.CommitDetail var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.DiffLimits) (domain.CommitDetail, error)); ok { return returnFunc(ctx, repo, rev, limits) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.DiffLimits) domain.CommitDetail); ok { r0 = returnFunc(ctx, repo, rev, limits) } else { r0 = ret.Get(0).(domain.CommitDetail) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.Revision, domain.DiffLimits) error); ok { r1 = returnFunc(ctx, repo, rev, limits) } else { r1 = ret.Error(1) } return r0, r1 } // RepoReader_GetCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCommit' type RepoReader_GetCommit_Call struct { *mock.Call } // GetCommit is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - rev domain.Revision // - limits domain.DiffLimits func (_e *RepoReader_Expecter) GetCommit(ctx any, repo any, rev any, limits any) *RepoReader_GetCommit_Call { return &RepoReader_GetCommit_Call{Call: _e.mock.On("GetCommit", ctx, repo, rev, limits)} } func (_c *RepoReader_GetCommit_Call) Run(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, limits domain.DiffLimits)) *RepoReader_GetCommit_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.Revision if args[2] != nil { arg2 = args[2].(domain.Revision) } var arg3 domain.DiffLimits if args[3] != nil { arg3 = args[3].(domain.DiffLimits) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *RepoReader_GetCommit_Call) Return(commitDetail domain.CommitDetail, err error) *RepoReader_GetCommit_Call { _c.Call.Return(commitDetail, err) return _c } func (_c *RepoReader_GetCommit_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, limits domain.DiffLimits) (domain.CommitDetail, error)) *RepoReader_GetCommit_Call { _c.Call.Return(run) return _c } // GetTree provides a mock function for the type RepoReader func (_mock *RepoReader) GetTree(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath, includeLastCommit bool) (domain.Tree, error) { ret := _mock.Called(ctx, repo, rev, path, includeLastCommit) if len(ret) == 0 { panic("no return value specified for GetTree") } var r0 domain.Tree var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath, bool) (domain.Tree, error)); ok { return returnFunc(ctx, repo, rev, path, includeLastCommit) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath, bool) domain.Tree); ok { r0 = returnFunc(ctx, repo, rev, path, includeLastCommit) } else { r0 = ret.Get(0).(domain.Tree) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath, bool) error); ok { r1 = returnFunc(ctx, repo, rev, path, includeLastCommit) } else { r1 = ret.Error(1) } return r0, r1 } // RepoReader_GetTree_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTree' type RepoReader_GetTree_Call struct { *mock.Call } // GetTree is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - rev domain.Revision // - path domain.TreePath // - includeLastCommit bool func (_e *RepoReader_Expecter) GetTree(ctx any, repo any, rev any, path any, includeLastCommit any) *RepoReader_GetTree_Call { return &RepoReader_GetTree_Call{Call: _e.mock.On("GetTree", ctx, repo, rev, path, includeLastCommit)} } func (_c *RepoReader_GetTree_Call) Run(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath, includeLastCommit bool)) *RepoReader_GetTree_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.Revision if args[2] != nil { arg2 = args[2].(domain.Revision) } var arg3 domain.TreePath if args[3] != nil { arg3 = args[3].(domain.TreePath) } var arg4 bool if args[4] != nil { arg4 = args[4].(bool) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *RepoReader_GetTree_Call) Return(tree domain.Tree, err error) *RepoReader_GetTree_Call { _c.Call.Return(tree, err) return _c } func (_c *RepoReader_GetTree_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath, includeLastCommit bool) (domain.Tree, error)) *RepoReader_GetTree_Call { _c.Call.Return(run) return _c } // ListCommits provides a mock function for the type RepoReader func (_mock *RepoReader) ListCommits(ctx context.Context, repo domain.RepoName, q ports.CommitQuery) (ports.CommitPage, error) { ret := _mock.Called(ctx, repo, q) if len(ret) == 0 { panic("no return value specified for ListCommits") } var r0 ports.CommitPage var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, ports.CommitQuery) (ports.CommitPage, error)); ok { return returnFunc(ctx, repo, q) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, ports.CommitQuery) ports.CommitPage); ok { r0 = returnFunc(ctx, repo, q) } else { r0 = ret.Get(0).(ports.CommitPage) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, ports.CommitQuery) error); ok { r1 = returnFunc(ctx, repo, q) } else { r1 = ret.Error(1) } return r0, r1 } // RepoReader_ListCommits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListCommits' type RepoReader_ListCommits_Call struct { *mock.Call } // ListCommits is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - q ports.CommitQuery func (_e *RepoReader_Expecter) ListCommits(ctx any, repo any, q any) *RepoReader_ListCommits_Call { return &RepoReader_ListCommits_Call{Call: _e.mock.On("ListCommits", ctx, repo, q)} } func (_c *RepoReader_ListCommits_Call) Run(run func(ctx context.Context, repo domain.RepoName, q ports.CommitQuery)) *RepoReader_ListCommits_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.CommitQuery if args[2] != nil { arg2 = args[2].(ports.CommitQuery) } run( arg0, arg1, arg2, ) }) return _c } func (_c *RepoReader_ListCommits_Call) Return(commitPage ports.CommitPage, err error) *RepoReader_ListCommits_Call { _c.Call.Return(commitPage, err) return _c } func (_c *RepoReader_ListCommits_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, q ports.CommitQuery) (ports.CommitPage, error)) *RepoReader_ListCommits_Call { _c.Call.Return(run) return _c } // ListPaths provides a mock function for the type RepoReader func (_mock *RepoReader) ListPaths(ctx context.Context, repo domain.RepoName, rev domain.Revision, maxPaths int, maxBytes int) (domain.PathList, error) { ret := _mock.Called(ctx, repo, rev, maxPaths, maxBytes) if len(ret) == 0 { panic("no return value specified for ListPaths") } var r0 domain.PathList var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, int, int) (domain.PathList, error)); ok { return returnFunc(ctx, repo, rev, maxPaths, maxBytes) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, int, int) domain.PathList); ok { r0 = returnFunc(ctx, repo, rev, maxPaths, maxBytes) } else { r0 = ret.Get(0).(domain.PathList) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.Revision, int, int) error); ok { r1 = returnFunc(ctx, repo, rev, maxPaths, maxBytes) } else { r1 = ret.Error(1) } return r0, r1 } // RepoReader_ListPaths_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPaths' type RepoReader_ListPaths_Call struct { *mock.Call } // ListPaths is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - rev domain.Revision // - maxPaths int // - maxBytes int func (_e *RepoReader_Expecter) ListPaths(ctx any, repo any, rev any, maxPaths any, maxBytes any) *RepoReader_ListPaths_Call { return &RepoReader_ListPaths_Call{Call: _e.mock.On("ListPaths", ctx, repo, rev, maxPaths, maxBytes)} } func (_c *RepoReader_ListPaths_Call) Run(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, maxPaths int, maxBytes int)) *RepoReader_ListPaths_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.Revision if args[2] != nil { arg2 = args[2].(domain.Revision) } var arg3 int if args[3] != nil { arg3 = args[3].(int) } var arg4 int if args[4] != nil { arg4 = args[4].(int) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *RepoReader_ListPaths_Call) Return(pathList domain.PathList, err error) *RepoReader_ListPaths_Call { _c.Call.Return(pathList, err) return _c } func (_c *RepoReader_ListPaths_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, maxPaths int, maxBytes int) (domain.PathList, error)) *RepoReader_ListPaths_Call { _c.Call.Return(run) return _c } // ListRefs provides a mock function for the type RepoReader func (_mock *RepoReader) ListRefs(ctx context.Context, repo domain.RepoName) ([]domain.Ref, error) { ret := _mock.Called(ctx, repo) if len(ret) == 0 { panic("no return value specified for ListRefs") } var r0 []domain.Ref var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) ([]domain.Ref, error)); ok { return returnFunc(ctx, repo) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) []domain.Ref); ok { r0 = returnFunc(ctx, repo) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]domain.Ref) } } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName) error); ok { r1 = returnFunc(ctx, repo) } else { r1 = ret.Error(1) } return r0, r1 } // RepoReader_ListRefs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRefs' type RepoReader_ListRefs_Call struct { *mock.Call } // ListRefs is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName func (_e *RepoReader_Expecter) ListRefs(ctx any, repo any) *RepoReader_ListRefs_Call { return &RepoReader_ListRefs_Call{Call: _e.mock.On("ListRefs", ctx, repo)} } func (_c *RepoReader_ListRefs_Call) Run(run func(ctx context.Context, repo domain.RepoName)) *RepoReader_ListRefs_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) } run( arg0, arg1, ) }) return _c } func (_c *RepoReader_ListRefs_Call) Return(refs []domain.Ref, err error) *RepoReader_ListRefs_Call { _c.Call.Return(refs, err) return _c } func (_c *RepoReader_ListRefs_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName) ([]domain.Ref, error)) *RepoReader_ListRefs_Call { _c.Call.Return(run) return _c } // OpenBlob provides a mock function for the type RepoReader func (_mock *RepoReader) OpenBlob(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath) (domain.BlobInfo, io.ReadCloser, error) { ret := _mock.Called(ctx, repo, rev, path) if len(ret) == 0 { panic("no return value specified for OpenBlob") } var r0 domain.BlobInfo var r1 io.ReadCloser var r2 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath) (domain.BlobInfo, io.ReadCloser, error)); ok { return returnFunc(ctx, repo, rev, path) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath) domain.BlobInfo); ok { r0 = returnFunc(ctx, repo, rev, path) } else { r0 = ret.Get(0).(domain.BlobInfo) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath) io.ReadCloser); ok { r1 = returnFunc(ctx, repo, rev, path) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(io.ReadCloser) } } if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, domain.Revision, domain.TreePath) error); ok { r2 = returnFunc(ctx, repo, rev, path) } else { r2 = ret.Error(2) } return r0, r1, r2 } // RepoReader_OpenBlob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenBlob' type RepoReader_OpenBlob_Call struct { *mock.Call } // OpenBlob is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - rev domain.Revision // - path domain.TreePath func (_e *RepoReader_Expecter) OpenBlob(ctx any, repo any, rev any, path any) *RepoReader_OpenBlob_Call { return &RepoReader_OpenBlob_Call{Call: _e.mock.On("OpenBlob", ctx, repo, rev, path)} } func (_c *RepoReader_OpenBlob_Call) Run(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath)) *RepoReader_OpenBlob_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.Revision if args[2] != nil { arg2 = args[2].(domain.Revision) } var arg3 domain.TreePath if args[3] != nil { arg3 = args[3].(domain.TreePath) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *RepoReader_OpenBlob_Call) Return(blobInfo domain.BlobInfo, readCloser io.ReadCloser, err error) *RepoReader_OpenBlob_Call { _c.Call.Return(blobInfo, readCloser, err) return _c } func (_c *RepoReader_OpenBlob_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision, path domain.TreePath) (domain.BlobInfo, io.ReadCloser, error)) *RepoReader_OpenBlob_Call { _c.Call.Return(run) return _c } // ResolveRefPath provides a mock function for the type RepoReader func (_mock *RepoReader) ResolveRefPath(ctx context.Context, repo domain.RepoName, path string) (domain.RefPath, error) { ret := _mock.Called(ctx, repo, path) if len(ret) == 0 { panic("no return value specified for ResolveRefPath") } var r0 domain.RefPath var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) (domain.RefPath, error)); ok { return returnFunc(ctx, repo, path) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) domain.RefPath); ok { r0 = returnFunc(ctx, repo, path) } else { r0 = ret.Get(0).(domain.RefPath) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, string) error); ok { r1 = returnFunc(ctx, repo, path) } else { r1 = ret.Error(1) } return r0, r1 } // RepoReader_ResolveRefPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResolveRefPath' type RepoReader_ResolveRefPath_Call struct { *mock.Call } // ResolveRefPath is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - path string func (_e *RepoReader_Expecter) ResolveRefPath(ctx any, repo any, path any) *RepoReader_ResolveRefPath_Call { return &RepoReader_ResolveRefPath_Call{Call: _e.mock.On("ResolveRefPath", ctx, repo, path)} } func (_c *RepoReader_ResolveRefPath_Call) Run(run func(ctx context.Context, repo domain.RepoName, path string)) *RepoReader_ResolveRefPath_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 string if args[2] != nil { arg2 = args[2].(string) } run( arg0, arg1, arg2, ) }) return _c } func (_c *RepoReader_ResolveRefPath_Call) Return(refPath domain.RefPath, err error) *RepoReader_ResolveRefPath_Call { _c.Call.Return(refPath, err) return _c } func (_c *RepoReader_ResolveRefPath_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, path string) (domain.RefPath, error)) *RepoReader_ResolveRefPath_Call { _c.Call.Return(run) return _c } // ResolveRevision provides a mock function for the type RepoReader func (_mock *RepoReader) ResolveRevision(ctx context.Context, repo domain.RepoName, rev domain.Revision) (domain.ResolvedRevision, error) { ret := _mock.Called(ctx, repo, rev) if len(ret) == 0 { panic("no return value specified for ResolveRevision") } var r0 domain.ResolvedRevision var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision) (domain.ResolvedRevision, error)); ok { return returnFunc(ctx, repo, rev) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Revision) domain.ResolvedRevision); ok { r0 = returnFunc(ctx, repo, rev) } else { r0 = ret.Get(0).(domain.ResolvedRevision) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.Revision) error); ok { r1 = returnFunc(ctx, repo, rev) } else { r1 = ret.Error(1) } return r0, r1 } // RepoReader_ResolveRevision_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResolveRevision' type RepoReader_ResolveRevision_Call struct { *mock.Call } // ResolveRevision is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - rev domain.Revision func (_e *RepoReader_Expecter) ResolveRevision(ctx any, repo any, rev any) *RepoReader_ResolveRevision_Call { return &RepoReader_ResolveRevision_Call{Call: _e.mock.On("ResolveRevision", ctx, repo, rev)} } func (_c *RepoReader_ResolveRevision_Call) Run(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision)) *RepoReader_ResolveRevision_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.Revision if args[2] != nil { arg2 = args[2].(domain.Revision) } run( arg0, arg1, arg2, ) }) return _c } func (_c *RepoReader_ResolveRevision_Call) Return(resolvedRevision domain.ResolvedRevision, err error) *RepoReader_ResolveRevision_Call { _c.Call.Return(resolvedRevision, err) return _c } func (_c *RepoReader_ResolveRevision_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, rev domain.Revision) (domain.ResolvedRevision, error)) *RepoReader_ResolveRevision_Call { _c.Call.Return(run) return _c }