// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "io" "bnema.dev/ermite/internal/domain" mock "github.com/stretchr/testify/mock" ) // NewGitHubAPIService creates a new instance of GitHubAPIService. 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 NewGitHubAPIService(t interface { mock.TestingT Cleanup(func()) }) *GitHubAPIService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &GitHubAPIService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // GitHubAPIService is an autogenerated mock type for the GitHubAPIService type type GitHubAPIService struct { mock.Mock } type GitHubAPIService_Expecter struct { mock *mock.Mock } func (_m *GitHubAPIService) EXPECT() *GitHubAPIService_Expecter { return &GitHubAPIService_Expecter{mock: &_m.Mock} } // GetRepo provides a mock function for the type GitHubAPIService func (_mock *GitHubAPIService) GetRepo(ctx context.Context, p domain.Principal, owner string, repo string) ([]byte, error) { ret := _mock.Called(ctx, p, owner, repo) if len(ret) == 0 { panic("no return value specified for GetRepo") } var r0 []byte var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string) ([]byte, error)); ok { return returnFunc(ctx, p, owner, repo) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string) []byte); ok { r0 = returnFunc(ctx, p, owner, repo) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]byte) } } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, string, string) error); ok { r1 = returnFunc(ctx, p, owner, repo) } else { r1 = ret.Error(1) } return r0, r1 } // GitHubAPIService_GetRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepo' type GitHubAPIService_GetRepo_Call struct { *mock.Call } // GetRepo is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - owner string // - repo string func (_e *GitHubAPIService_Expecter) GetRepo(ctx any, p any, owner any, repo any) *GitHubAPIService_GetRepo_Call { return &GitHubAPIService_GetRepo_Call{Call: _e.mock.On("GetRepo", ctx, p, owner, repo)} } func (_c *GitHubAPIService_GetRepo_Call) Run(run func(ctx context.Context, p domain.Principal, owner string, repo string)) *GitHubAPIService_GetRepo_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 string if args[2] != nil { arg2 = args[2].(string) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *GitHubAPIService_GetRepo_Call) Return(bytes []byte, err error) *GitHubAPIService_GetRepo_Call { _c.Call.Return(bytes, err) return _c } func (_c *GitHubAPIService_GetRepo_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, owner string, repo string) ([]byte, error)) *GitHubAPIService_GetRepo_Call { _c.Call.Return(run) return _c } // HashAlgorithm provides a mock function for the type GitHubAPIService func (_mock *GitHubAPIService) HashAlgorithm(ctx context.Context, p domain.Principal, owner string, repo string) (string, error) { ret := _mock.Called(ctx, p, owner, repo) if len(ret) == 0 { panic("no return value specified for HashAlgorithm") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string) (string, error)); ok { return returnFunc(ctx, p, owner, repo) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string) string); ok { r0 = returnFunc(ctx, p, owner, repo) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, string, string) error); ok { r1 = returnFunc(ctx, p, owner, repo) } else { r1 = ret.Error(1) } return r0, r1 } // GitHubAPIService_HashAlgorithm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashAlgorithm' type GitHubAPIService_HashAlgorithm_Call struct { *mock.Call } // HashAlgorithm is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - owner string // - repo string func (_e *GitHubAPIService_Expecter) HashAlgorithm(ctx any, p any, owner any, repo any) *GitHubAPIService_HashAlgorithm_Call { return &GitHubAPIService_HashAlgorithm_Call{Call: _e.mock.On("HashAlgorithm", ctx, p, owner, repo)} } func (_c *GitHubAPIService_HashAlgorithm_Call) Run(run func(ctx context.Context, p domain.Principal, owner string, repo string)) *GitHubAPIService_HashAlgorithm_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 string if args[2] != nil { arg2 = args[2].(string) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *GitHubAPIService_HashAlgorithm_Call) Return(s string, err error) *GitHubAPIService_HashAlgorithm_Call { _c.Call.Return(s, err) return _c } func (_c *GitHubAPIService_HashAlgorithm_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, owner string, repo string) (string, error)) *GitHubAPIService_HashAlgorithm_Call { _c.Call.Return(run) return _c } // ListPullFiles provides a mock function for the type GitHubAPIService func (_mock *GitHubAPIService) ListPullFiles(ctx context.Context, p domain.Principal, owner string, repo string, number int64, page int, perPage int) ([]byte, string, error) { ret := _mock.Called(ctx, p, owner, repo, number, page, perPage) if len(ret) == 0 { panic("no return value specified for ListPullFiles") } var r0 []byte var r1 string var r2 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string, int64, int, int) ([]byte, string, error)); ok { return returnFunc(ctx, p, owner, repo, number, page, perPage) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string, int64, int, int) []byte); ok { r0 = returnFunc(ctx, p, owner, repo, number, page, perPage) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]byte) } } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, string, string, int64, int, int) string); ok { r1 = returnFunc(ctx, p, owner, repo, number, page, perPage) } else { r1 = ret.Get(1).(string) } if returnFunc, ok := ret.Get(2).(func(context.Context, domain.Principal, string, string, int64, int, int) error); ok { r2 = returnFunc(ctx, p, owner, repo, number, page, perPage) } else { r2 = ret.Error(2) } return r0, r1, r2 } // GitHubAPIService_ListPullFiles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPullFiles' type GitHubAPIService_ListPullFiles_Call struct { *mock.Call } // ListPullFiles is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - owner string // - repo string // - number int64 // - page int // - perPage int func (_e *GitHubAPIService_Expecter) ListPullFiles(ctx any, p any, owner any, repo any, number any, page any, perPage any) *GitHubAPIService_ListPullFiles_Call { return &GitHubAPIService_ListPullFiles_Call{Call: _e.mock.On("ListPullFiles", ctx, p, owner, repo, number, page, perPage)} } func (_c *GitHubAPIService_ListPullFiles_Call) Run(run func(ctx context.Context, p domain.Principal, owner string, repo string, number int64, page int, perPage int)) *GitHubAPIService_ListPullFiles_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 string if args[2] != nil { arg2 = args[2].(string) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } var arg4 int64 if args[4] != nil { arg4 = args[4].(int64) } var arg5 int if args[5] != nil { arg5 = args[5].(int) } var arg6 int if args[6] != nil { arg6 = args[6].(int) } run( arg0, arg1, arg2, arg3, arg4, arg5, arg6, ) }) return _c } func (_c *GitHubAPIService_ListPullFiles_Call) Return(body []byte, link string, err error) *GitHubAPIService_ListPullFiles_Call { _c.Call.Return(body, link, err) return _c } func (_c *GitHubAPIService_ListPullFiles_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, owner string, repo string, number int64, page int, perPage int) ([]byte, string, error)) *GitHubAPIService_ListPullFiles_Call { _c.Call.Return(run) return _c } // Tarball provides a mock function for the type GitHubAPIService func (_mock *GitHubAPIService) Tarball(ctx context.Context, p domain.Principal, owner string, repo string, ref string, begin func(filename string) io.Writer) error { ret := _mock.Called(ctx, p, owner, repo, ref, begin) if len(ret) == 0 { panic("no return value specified for Tarball") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string, string, func(filename string) io.Writer) error); ok { r0 = returnFunc(ctx, p, owner, repo, ref, begin) } else { r0 = ret.Error(0) } return r0 } // GitHubAPIService_Tarball_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tarball' type GitHubAPIService_Tarball_Call struct { *mock.Call } // Tarball is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - owner string // - repo string // - ref string // - begin func(filename string) io.Writer func (_e *GitHubAPIService_Expecter) Tarball(ctx any, p any, owner any, repo any, ref any, begin any) *GitHubAPIService_Tarball_Call { return &GitHubAPIService_Tarball_Call{Call: _e.mock.On("Tarball", ctx, p, owner, repo, ref, begin)} } func (_c *GitHubAPIService_Tarball_Call) Run(run func(ctx context.Context, p domain.Principal, owner string, repo string, ref string, begin func(filename string) io.Writer)) *GitHubAPIService_Tarball_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 string if args[2] != nil { arg2 = args[2].(string) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } var arg4 string if args[4] != nil { arg4 = args[4].(string) } var arg5 func(filename string) io.Writer if args[5] != nil { arg5 = args[5].(func(filename string) io.Writer) } run( arg0, arg1, arg2, arg3, arg4, arg5, ) }) return _c } func (_c *GitHubAPIService_Tarball_Call) Return(err error) *GitHubAPIService_Tarball_Call { _c.Call.Return(err) return _c } func (_c *GitHubAPIService_Tarball_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, owner string, repo string, ref string, begin func(filename string) io.Writer) error) *GitHubAPIService_Tarball_Call { _c.Call.Return(run) return _c } // TarballName provides a mock function for the type GitHubAPIService func (_mock *GitHubAPIService) TarballName(ctx context.Context, p domain.Principal, owner string, repo string, ref string) (string, error) { ret := _mock.Called(ctx, p, owner, repo, ref) if len(ret) == 0 { panic("no return value specified for TarballName") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string, string) (string, error)); ok { return returnFunc(ctx, p, owner, repo, ref) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string, string) string); ok { r0 = returnFunc(ctx, p, owner, repo, ref) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, string, string, string) error); ok { r1 = returnFunc(ctx, p, owner, repo, ref) } else { r1 = ret.Error(1) } return r0, r1 } // GitHubAPIService_TarballName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TarballName' type GitHubAPIService_TarballName_Call struct { *mock.Call } // TarballName is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - owner string // - repo string // - ref string func (_e *GitHubAPIService_Expecter) TarballName(ctx any, p any, owner any, repo any, ref any) *GitHubAPIService_TarballName_Call { return &GitHubAPIService_TarballName_Call{Call: _e.mock.On("TarballName", ctx, p, owner, repo, ref)} } func (_c *GitHubAPIService_TarballName_Call) Run(run func(ctx context.Context, p domain.Principal, owner string, repo string, ref string)) *GitHubAPIService_TarballName_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 string if args[2] != nil { arg2 = args[2].(string) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } var arg4 string if args[4] != nil { arg4 = args[4].(string) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *GitHubAPIService_TarballName_Call) Return(s string, err error) *GitHubAPIService_TarballName_Call { _c.Call.Return(s, err) return _c } func (_c *GitHubAPIService_TarballName_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, owner string, repo string, ref string) (string, error)) *GitHubAPIService_TarballName_Call { _c.Call.Return(run) return _c }