// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" mock "github.com/stretchr/testify/mock" ) // NewWorkflowFetcher creates a new instance of WorkflowFetcher. 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 NewWorkflowFetcher(t interface { mock.TestingT Cleanup(func()) }) *WorkflowFetcher { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &WorkflowFetcher{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // WorkflowFetcher is an autogenerated mock type for the WorkflowFetcher type type WorkflowFetcher struct { mock.Mock } type WorkflowFetcher_Expecter struct { mock *mock.Mock } func (_m *WorkflowFetcher) EXPECT() *WorkflowFetcher_Expecter { return &WorkflowFetcher_Expecter{mock: &_m.Mock} } // FetchWorkflow provides a mock function for the type WorkflowFetcher func (_mock *WorkflowFetcher) FetchWorkflow(ctx context.Context, owner string, repo string, sha string, path string, maxBytes int64) ([]byte, error) { ret := _mock.Called(ctx, owner, repo, sha, path, maxBytes) if len(ret) == 0 { panic("no return value specified for FetchWorkflow") } var r0 []byte var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, string, int64) ([]byte, error)); ok { return returnFunc(ctx, owner, repo, sha, path, maxBytes) } if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, string, int64) []byte); ok { r0 = returnFunc(ctx, owner, repo, sha, path, maxBytes) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]byte) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, string, string, int64) error); ok { r1 = returnFunc(ctx, owner, repo, sha, path, maxBytes) } else { r1 = ret.Error(1) } return r0, r1 } // WorkflowFetcher_FetchWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchWorkflow' type WorkflowFetcher_FetchWorkflow_Call struct { *mock.Call } // FetchWorkflow is a helper method to define mock.On call // - ctx context.Context // - owner string // - repo string // - sha string // - path string // - maxBytes int64 func (_e *WorkflowFetcher_Expecter) FetchWorkflow(ctx any, owner any, repo any, sha any, path any, maxBytes any) *WorkflowFetcher_FetchWorkflow_Call { return &WorkflowFetcher_FetchWorkflow_Call{Call: _e.mock.On("FetchWorkflow", ctx, owner, repo, sha, path, maxBytes)} } func (_c *WorkflowFetcher_FetchWorkflow_Call) Run(run func(ctx context.Context, owner string, repo string, sha string, path string, maxBytes int64)) *WorkflowFetcher_FetchWorkflow_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } 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 int64 if args[5] != nil { arg5 = args[5].(int64) } run( arg0, arg1, arg2, arg3, arg4, arg5, ) }) return _c } func (_c *WorkflowFetcher_FetchWorkflow_Call) Return(bytes []byte, err error) *WorkflowFetcher_FetchWorkflow_Call { _c.Call.Return(bytes, err) return _c } func (_c *WorkflowFetcher_FetchWorkflow_Call) RunAndReturn(run func(ctx context.Context, owner string, repo string, sha string, path string, maxBytes int64) ([]byte, error)) *WorkflowFetcher_FetchWorkflow_Call { _c.Call.Return(run) return _c }