1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9
10 "bnema.dev/ermite/internal/domain"
11 mock "github.com/stretchr/testify/mock"
12)
13
14// NewPullGit creates a new instance of PullGit. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func NewPullGit(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *PullGit {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &PullGit{}
25 mock.Mock.Test(t)
26
27 t.Cleanup(func() {
28 if helper, ok := t.(interface{ Helper() }); ok {
29 helper.Helper()
30 }
31 mock.AssertExpectations(t)
32 })
33
34 return mock
35}
36
37// PullGit is an autogenerated mock type for the PullGit type
38type PullGit struct {
39 mock.Mock
40}
41
42type PullGit_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *PullGit) EXPECT() *PullGit_Expecter {
47 return &PullGit_Expecter{mock: &_m.Mock}
48}
49
50// PullRef provides a mock function for the type PullGit
51func (_mock *PullGit) PullRef(ctx context.Context, repo domain.RepoName, ref string) (domain.ObjectID, error) {
52 ret := _mock.Called(ctx, repo, ref)
53
54 if len(ret) == 0 {
55 panic("no return value specified for PullRef")
56 }
57
58 var r0 domain.ObjectID
59 var r1 error
60 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) (domain.ObjectID, error)); ok {
61 return returnFunc(ctx, repo, ref)
62 }
63 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) domain.ObjectID); ok {
64 r0 = returnFunc(ctx, repo, ref)
65 } else {
66 r0 = ret.Get(0).(domain.ObjectID)
67 }
68 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, string) error); ok {
69 r1 = returnFunc(ctx, repo, ref)
70 } else {
71 r1 = ret.Error(1)
72 }
73 return r0, r1
74}
75
76// PullGit_PullRef_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PullRef'
77type PullGit_PullRef_Call struct {
78 *mock.Call
79}
80
81// PullRef is a helper method to define mock.On call
82// - ctx context.Context
83// - repo domain.RepoName
84// - ref string
85func (_e *PullGit_Expecter) PullRef(ctx any, repo any, ref any) *PullGit_PullRef_Call {
86 return &PullGit_PullRef_Call{Call: _e.mock.On("PullRef", ctx, repo, ref)}
87}
88
89func (_c *PullGit_PullRef_Call) Run(run func(ctx context.Context, repo domain.RepoName, ref string)) *PullGit_PullRef_Call {
90 _c.Call.Run(func(args mock.Arguments) {
91 var arg0 context.Context
92 if args[0] != nil {
93 arg0 = args[0].(context.Context)
94 }
95 var arg1 domain.RepoName
96 if args[1] != nil {
97 arg1 = args[1].(domain.RepoName)
98 }
99 var arg2 string
100 if args[2] != nil {
101 arg2 = args[2].(string)
102 }
103 run(
104 arg0,
105 arg1,
106 arg2,
107 )
108 })
109 return _c
110}
111
112func (_c *PullGit_PullRef_Call) Return(objectID domain.ObjectID, err error) *PullGit_PullRef_Call {
113 _c.Call.Return(objectID, err)
114 return _c
115}
116
117func (_c *PullGit_PullRef_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, ref string) (domain.ObjectID, error)) *PullGit_PullRef_Call {
118 _c.Call.Return(run)
119 return _c
120}
121
122// SetPullRef provides a mock function for the type PullGit
123func (_mock *PullGit) SetPullRef(ctx context.Context, repo domain.RepoName, ref string, id domain.ObjectID) error {
124 ret := _mock.Called(ctx, repo, ref, id)
125
126 if len(ret) == 0 {
127 panic("no return value specified for SetPullRef")
128 }
129
130 var r0 error
131 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string, domain.ObjectID) error); ok {
132 r0 = returnFunc(ctx, repo, ref, id)
133 } else {
134 r0 = ret.Error(0)
135 }
136 return r0
137}
138
139// PullGit_SetPullRef_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPullRef'
140type PullGit_SetPullRef_Call struct {
141 *mock.Call
142}
143
144// SetPullRef is a helper method to define mock.On call
145// - ctx context.Context
146// - repo domain.RepoName
147// - ref string
148// - id domain.ObjectID
149func (_e *PullGit_Expecter) SetPullRef(ctx any, repo any, ref any, id any) *PullGit_SetPullRef_Call {
150 return &PullGit_SetPullRef_Call{Call: _e.mock.On("SetPullRef", ctx, repo, ref, id)}
151}
152
153func (_c *PullGit_SetPullRef_Call) Run(run func(ctx context.Context, repo domain.RepoName, ref string, id domain.ObjectID)) *PullGit_SetPullRef_Call {
154 _c.Call.Run(func(args mock.Arguments) {
155 var arg0 context.Context
156 if args[0] != nil {
157 arg0 = args[0].(context.Context)
158 }
159 var arg1 domain.RepoName
160 if args[1] != nil {
161 arg1 = args[1].(domain.RepoName)
162 }
163 var arg2 string
164 if args[2] != nil {
165 arg2 = args[2].(string)
166 }
167 var arg3 domain.ObjectID
168 if args[3] != nil {
169 arg3 = args[3].(domain.ObjectID)
170 }
171 run(
172 arg0,
173 arg1,
174 arg2,
175 arg3,
176 )
177 })
178 return _c
179}
180
181func (_c *PullGit_SetPullRef_Call) Return(err error) *PullGit_SetPullRef_Call {
182 _c.Call.Return(err)
183 return _c
184}
185
186func (_c *PullGit_SetPullRef_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, ref string, id domain.ObjectID) error) *PullGit_SetPullRef_Call {
187 _c.Call.Return(run)
188 return _c
189}
190
191// TestMerge provides a mock function for the type PullGit
192func (_mock *PullGit) TestMerge(ctx context.Context, repo domain.RepoName, base domain.ObjectID, head domain.ObjectID) (domain.ObjectID, bool, error) {
193 ret := _mock.Called(ctx, repo, base, head)
194
195 if len(ret) == 0 {
196 panic("no return value specified for TestMerge")
197 }
198
199 var r0 domain.ObjectID
200 var r1 bool
201 var r2 error
202 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) (domain.ObjectID, bool, error)); ok {
203 return returnFunc(ctx, repo, base, head)
204 }
205 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) domain.ObjectID); ok {
206 r0 = returnFunc(ctx, repo, base, head)
207 } else {
208 r0 = ret.Get(0).(domain.ObjectID)
209 }
210 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) bool); ok {
211 r1 = returnFunc(ctx, repo, base, head)
212 } else {
213 r1 = ret.Get(1).(bool)
214 }
215 if returnFunc, ok := ret.Get(2).(func(context.Context, domain.RepoName, domain.ObjectID, domain.ObjectID) error); ok {
216 r2 = returnFunc(ctx, repo, base, head)
217 } else {
218 r2 = ret.Error(2)
219 }
220 return r0, r1, r2
221}
222
223// PullGit_TestMerge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TestMerge'
224type PullGit_TestMerge_Call struct {
225 *mock.Call
226}
227
228// TestMerge is a helper method to define mock.On call
229// - ctx context.Context
230// - repo domain.RepoName
231// - base domain.ObjectID
232// - head domain.ObjectID
233func (_e *PullGit_Expecter) TestMerge(ctx any, repo any, base any, head any) *PullGit_TestMerge_Call {
234 return &PullGit_TestMerge_Call{Call: _e.mock.On("TestMerge", ctx, repo, base, head)}
235}
236
237func (_c *PullGit_TestMerge_Call) Run(run func(ctx context.Context, repo domain.RepoName, base domain.ObjectID, head domain.ObjectID)) *PullGit_TestMerge_Call {
238 _c.Call.Run(func(args mock.Arguments) {
239 var arg0 context.Context
240 if args[0] != nil {
241 arg0 = args[0].(context.Context)
242 }
243 var arg1 domain.RepoName
244 if args[1] != nil {
245 arg1 = args[1].(domain.RepoName)
246 }
247 var arg2 domain.ObjectID
248 if args[2] != nil {
249 arg2 = args[2].(domain.ObjectID)
250 }
251 var arg3 domain.ObjectID
252 if args[3] != nil {
253 arg3 = args[3].(domain.ObjectID)
254 }
255 run(
256 arg0,
257 arg1,
258 arg2,
259 arg3,
260 )
261 })
262 return _c
263}
264
265func (_c *PullGit_TestMerge_Call) Return(tree domain.ObjectID, clean bool, err error) *PullGit_TestMerge_Call {
266 _c.Call.Return(tree, clean, err)
267 return _c
268}
269
270func (_c *PullGit_TestMerge_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, base domain.ObjectID, head domain.ObjectID) (domain.ObjectID, bool, error)) *PullGit_TestMerge_Call {
271 _c.Call.Return(run)
272 return _c
273}