1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9 "io"
10
11 "bnema.dev/ermite/internal/domain"
12 mock "github.com/stretchr/testify/mock"
13)
14
15// 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.
16// The first argument is typically a *testing.T value.
17func NewGitHubAPIService(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *GitHubAPIService {
21 if helper, ok := t.(interface{ Helper() }); ok {
22 helper.Helper()
23 }
24
25 mock := &GitHubAPIService{}
26 mock.Mock.Test(t)
27
28 t.Cleanup(func() {
29 if helper, ok := t.(interface{ Helper() }); ok {
30 helper.Helper()
31 }
32 mock.AssertExpectations(t)
33 })
34
35 return mock
36}
37
38// GitHubAPIService is an autogenerated mock type for the GitHubAPIService type
39type GitHubAPIService struct {
40 mock.Mock
41}
42
43type GitHubAPIService_Expecter struct {
44 mock *mock.Mock
45}
46
47func (_m *GitHubAPIService) EXPECT() *GitHubAPIService_Expecter {
48 return &GitHubAPIService_Expecter{mock: &_m.Mock}
49}
50
51// GetRepo provides a mock function for the type GitHubAPIService
52func (_mock *GitHubAPIService) GetRepo(ctx context.Context, p domain.Principal, owner string, repo string) ([]byte, error) {
53 ret := _mock.Called(ctx, p, owner, repo)
54
55 if len(ret) == 0 {
56 panic("no return value specified for GetRepo")
57 }
58
59 var r0 []byte
60 var r1 error
61 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string) ([]byte, error)); ok {
62 return returnFunc(ctx, p, owner, repo)
63 }
64 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string) []byte); ok {
65 r0 = returnFunc(ctx, p, owner, repo)
66 } else {
67 if ret.Get(0) != nil {
68 r0 = ret.Get(0).([]byte)
69 }
70 }
71 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, string, string) error); ok {
72 r1 = returnFunc(ctx, p, owner, repo)
73 } else {
74 r1 = ret.Error(1)
75 }
76 return r0, r1
77}
78
79// GitHubAPIService_GetRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepo'
80type GitHubAPIService_GetRepo_Call struct {
81 *mock.Call
82}
83
84// GetRepo is a helper method to define mock.On call
85// - ctx context.Context
86// - p domain.Principal
87// - owner string
88// - repo string
89func (_e *GitHubAPIService_Expecter) GetRepo(ctx any, p any, owner any, repo any) *GitHubAPIService_GetRepo_Call {
90 return &GitHubAPIService_GetRepo_Call{Call: _e.mock.On("GetRepo", ctx, p, owner, repo)}
91}
92
93func (_c *GitHubAPIService_GetRepo_Call) Run(run func(ctx context.Context, p domain.Principal, owner string, repo string)) *GitHubAPIService_GetRepo_Call {
94 _c.Call.Run(func(args mock.Arguments) {
95 var arg0 context.Context
96 if args[0] != nil {
97 arg0 = args[0].(context.Context)
98 }
99 var arg1 domain.Principal
100 if args[1] != nil {
101 arg1 = args[1].(domain.Principal)
102 }
103 var arg2 string
104 if args[2] != nil {
105 arg2 = args[2].(string)
106 }
107 var arg3 string
108 if args[3] != nil {
109 arg3 = args[3].(string)
110 }
111 run(
112 arg0,
113 arg1,
114 arg2,
115 arg3,
116 )
117 })
118 return _c
119}
120
121func (_c *GitHubAPIService_GetRepo_Call) Return(bytes []byte, err error) *GitHubAPIService_GetRepo_Call {
122 _c.Call.Return(bytes, err)
123 return _c
124}
125
126func (_c *GitHubAPIService_GetRepo_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, owner string, repo string) ([]byte, error)) *GitHubAPIService_GetRepo_Call {
127 _c.Call.Return(run)
128 return _c
129}
130
131// HashAlgorithm provides a mock function for the type GitHubAPIService
132func (_mock *GitHubAPIService) HashAlgorithm(ctx context.Context, p domain.Principal, owner string, repo string) (string, error) {
133 ret := _mock.Called(ctx, p, owner, repo)
134
135 if len(ret) == 0 {
136 panic("no return value specified for HashAlgorithm")
137 }
138
139 var r0 string
140 var r1 error
141 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string) (string, error)); ok {
142 return returnFunc(ctx, p, owner, repo)
143 }
144 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string) string); ok {
145 r0 = returnFunc(ctx, p, owner, repo)
146 } else {
147 r0 = ret.Get(0).(string)
148 }
149 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, string, string) error); ok {
150 r1 = returnFunc(ctx, p, owner, repo)
151 } else {
152 r1 = ret.Error(1)
153 }
154 return r0, r1
155}
156
157// GitHubAPIService_HashAlgorithm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashAlgorithm'
158type GitHubAPIService_HashAlgorithm_Call struct {
159 *mock.Call
160}
161
162// HashAlgorithm is a helper method to define mock.On call
163// - ctx context.Context
164// - p domain.Principal
165// - owner string
166// - repo string
167func (_e *GitHubAPIService_Expecter) HashAlgorithm(ctx any, p any, owner any, repo any) *GitHubAPIService_HashAlgorithm_Call {
168 return &GitHubAPIService_HashAlgorithm_Call{Call: _e.mock.On("HashAlgorithm", ctx, p, owner, repo)}
169}
170
171func (_c *GitHubAPIService_HashAlgorithm_Call) Run(run func(ctx context.Context, p domain.Principal, owner string, repo string)) *GitHubAPIService_HashAlgorithm_Call {
172 _c.Call.Run(func(args mock.Arguments) {
173 var arg0 context.Context
174 if args[0] != nil {
175 arg0 = args[0].(context.Context)
176 }
177 var arg1 domain.Principal
178 if args[1] != nil {
179 arg1 = args[1].(domain.Principal)
180 }
181 var arg2 string
182 if args[2] != nil {
183 arg2 = args[2].(string)
184 }
185 var arg3 string
186 if args[3] != nil {
187 arg3 = args[3].(string)
188 }
189 run(
190 arg0,
191 arg1,
192 arg2,
193 arg3,
194 )
195 })
196 return _c
197}
198
199func (_c *GitHubAPIService_HashAlgorithm_Call) Return(s string, err error) *GitHubAPIService_HashAlgorithm_Call {
200 _c.Call.Return(s, err)
201 return _c
202}
203
204func (_c *GitHubAPIService_HashAlgorithm_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, owner string, repo string) (string, error)) *GitHubAPIService_HashAlgorithm_Call {
205 _c.Call.Return(run)
206 return _c
207}
208
209// Tarball provides a mock function for the type GitHubAPIService
210func (_mock *GitHubAPIService) Tarball(ctx context.Context, p domain.Principal, owner string, repo string, ref string, begin func(filename string) io.Writer) error {
211 ret := _mock.Called(ctx, p, owner, repo, ref, begin)
212
213 if len(ret) == 0 {
214 panic("no return value specified for Tarball")
215 }
216
217 var r0 error
218 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string, string, func(filename string) io.Writer) error); ok {
219 r0 = returnFunc(ctx, p, owner, repo, ref, begin)
220 } else {
221 r0 = ret.Error(0)
222 }
223 return r0
224}
225
226// GitHubAPIService_Tarball_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tarball'
227type GitHubAPIService_Tarball_Call struct {
228 *mock.Call
229}
230
231// Tarball is a helper method to define mock.On call
232// - ctx context.Context
233// - p domain.Principal
234// - owner string
235// - repo string
236// - ref string
237// - begin func(filename string) io.Writer
238func (_e *GitHubAPIService_Expecter) Tarball(ctx any, p any, owner any, repo any, ref any, begin any) *GitHubAPIService_Tarball_Call {
239 return &GitHubAPIService_Tarball_Call{Call: _e.mock.On("Tarball", ctx, p, owner, repo, ref, begin)}
240}
241
242func (_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 {
243 _c.Call.Run(func(args mock.Arguments) {
244 var arg0 context.Context
245 if args[0] != nil {
246 arg0 = args[0].(context.Context)
247 }
248 var arg1 domain.Principal
249 if args[1] != nil {
250 arg1 = args[1].(domain.Principal)
251 }
252 var arg2 string
253 if args[2] != nil {
254 arg2 = args[2].(string)
255 }
256 var arg3 string
257 if args[3] != nil {
258 arg3 = args[3].(string)
259 }
260 var arg4 string
261 if args[4] != nil {
262 arg4 = args[4].(string)
263 }
264 var arg5 func(filename string) io.Writer
265 if args[5] != nil {
266 arg5 = args[5].(func(filename string) io.Writer)
267 }
268 run(
269 arg0,
270 arg1,
271 arg2,
272 arg3,
273 arg4,
274 arg5,
275 )
276 })
277 return _c
278}
279
280func (_c *GitHubAPIService_Tarball_Call) Return(err error) *GitHubAPIService_Tarball_Call {
281 _c.Call.Return(err)
282 return _c
283}
284
285func (_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 {
286 _c.Call.Return(run)
287 return _c
288}
289
290// TarballName provides a mock function for the type GitHubAPIService
291func (_mock *GitHubAPIService) TarballName(ctx context.Context, p domain.Principal, owner string, repo string, ref string) (string, error) {
292 ret := _mock.Called(ctx, p, owner, repo, ref)
293
294 if len(ret) == 0 {
295 panic("no return value specified for TarballName")
296 }
297
298 var r0 string
299 var r1 error
300 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string, string) (string, error)); ok {
301 return returnFunc(ctx, p, owner, repo, ref)
302 }
303 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string, string, string) string); ok {
304 r0 = returnFunc(ctx, p, owner, repo, ref)
305 } else {
306 r0 = ret.Get(0).(string)
307 }
308 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, string, string, string) error); ok {
309 r1 = returnFunc(ctx, p, owner, repo, ref)
310 } else {
311 r1 = ret.Error(1)
312 }
313 return r0, r1
314}
315
316// GitHubAPIService_TarballName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TarballName'
317type GitHubAPIService_TarballName_Call struct {
318 *mock.Call
319}
320
321// TarballName is a helper method to define mock.On call
322// - ctx context.Context
323// - p domain.Principal
324// - owner string
325// - repo string
326// - ref string
327func (_e *GitHubAPIService_Expecter) TarballName(ctx any, p any, owner any, repo any, ref any) *GitHubAPIService_TarballName_Call {
328 return &GitHubAPIService_TarballName_Call{Call: _e.mock.On("TarballName", ctx, p, owner, repo, ref)}
329}
330
331func (_c *GitHubAPIService_TarballName_Call) Run(run func(ctx context.Context, p domain.Principal, owner string, repo string, ref string)) *GitHubAPIService_TarballName_Call {
332 _c.Call.Run(func(args mock.Arguments) {
333 var arg0 context.Context
334 if args[0] != nil {
335 arg0 = args[0].(context.Context)
336 }
337 var arg1 domain.Principal
338 if args[1] != nil {
339 arg1 = args[1].(domain.Principal)
340 }
341 var arg2 string
342 if args[2] != nil {
343 arg2 = args[2].(string)
344 }
345 var arg3 string
346 if args[3] != nil {
347 arg3 = args[3].(string)
348 }
349 var arg4 string
350 if args[4] != nil {
351 arg4 = args[4].(string)
352 }
353 run(
354 arg0,
355 arg1,
356 arg2,
357 arg3,
358 arg4,
359 )
360 })
361 return _c
362}
363
364func (_c *GitHubAPIService_TarballName_Call) Return(s string, err error) *GitHubAPIService_TarballName_Call {
365 _c.Call.Return(s, err)
366 return _c
367}
368
369func (_c *GitHubAPIService_TarballName_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, owner string, repo string, ref string) (string, error)) *GitHubAPIService_TarballName_Call {
370 _c.Call.Return(run)
371 return _c
372}