/
Tree.go
762 lines (625 loc) · 21.9 KB
/
Tree.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
// Copyright 2018-2022 CERN
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// In applying this license, CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
// Code generated by mockery v2.40.2. DO NOT EDIT.
package mocks
import (
context "context"
fs "io/fs"
io "io"
mock "github.com/stretchr/testify/mock"
node "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node"
)
// Tree is an autogenerated mock type for the Tree type
type Tree struct {
mock.Mock
}
type Tree_Expecter struct {
mock *mock.Mock
}
func (_m *Tree) EXPECT() *Tree_Expecter {
return &Tree_Expecter{mock: &_m.Mock}
}
// CreateDir provides a mock function with given fields: ctx, _a1
func (_m *Tree) CreateDir(ctx context.Context, _a1 *node.Node) error {
ret := _m.Called(ctx, _a1)
if len(ret) == 0 {
panic("no return value specified for CreateDir")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *node.Node) error); ok {
r0 = rf(ctx, _a1)
} else {
r0 = ret.Error(0)
}
return r0
}
// Tree_CreateDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDir'
type Tree_CreateDir_Call struct {
*mock.Call
}
// CreateDir is a helper method to define mock.On call
// - ctx context.Context
// - _a1 *node.Node
func (_e *Tree_Expecter) CreateDir(ctx interface{}, _a1 interface{}) *Tree_CreateDir_Call {
return &Tree_CreateDir_Call{Call: _e.mock.On("CreateDir", ctx, _a1)}
}
func (_c *Tree_CreateDir_Call) Run(run func(ctx context.Context, _a1 *node.Node)) *Tree_CreateDir_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*node.Node))
})
return _c
}
func (_c *Tree_CreateDir_Call) Return(err error) *Tree_CreateDir_Call {
_c.Call.Return(err)
return _c
}
func (_c *Tree_CreateDir_Call) RunAndReturn(run func(context.Context, *node.Node) error) *Tree_CreateDir_Call {
_c.Call.Return(run)
return _c
}
// Delete provides a mock function with given fields: ctx, _a1
func (_m *Tree) Delete(ctx context.Context, _a1 *node.Node) error {
ret := _m.Called(ctx, _a1)
if len(ret) == 0 {
panic("no return value specified for Delete")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *node.Node) error); ok {
r0 = rf(ctx, _a1)
} else {
r0 = ret.Error(0)
}
return r0
}
// Tree_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
type Tree_Delete_Call struct {
*mock.Call
}
// Delete is a helper method to define mock.On call
// - ctx context.Context
// - _a1 *node.Node
func (_e *Tree_Expecter) Delete(ctx interface{}, _a1 interface{}) *Tree_Delete_Call {
return &Tree_Delete_Call{Call: _e.mock.On("Delete", ctx, _a1)}
}
func (_c *Tree_Delete_Call) Run(run func(ctx context.Context, _a1 *node.Node)) *Tree_Delete_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*node.Node))
})
return _c
}
func (_c *Tree_Delete_Call) Return(err error) *Tree_Delete_Call {
_c.Call.Return(err)
return _c
}
func (_c *Tree_Delete_Call) RunAndReturn(run func(context.Context, *node.Node) error) *Tree_Delete_Call {
_c.Call.Return(run)
return _c
}
// DeleteBlob provides a mock function with given fields: _a0
func (_m *Tree) DeleteBlob(_a0 *node.Node) error {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for DeleteBlob")
}
var r0 error
if rf, ok := ret.Get(0).(func(*node.Node) error); ok {
r0 = rf(_a0)
} else {
r0 = ret.Error(0)
}
return r0
}
// Tree_DeleteBlob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteBlob'
type Tree_DeleteBlob_Call struct {
*mock.Call
}
// DeleteBlob is a helper method to define mock.On call
// - _a0 *node.Node
func (_e *Tree_Expecter) DeleteBlob(_a0 interface{}) *Tree_DeleteBlob_Call {
return &Tree_DeleteBlob_Call{Call: _e.mock.On("DeleteBlob", _a0)}
}
func (_c *Tree_DeleteBlob_Call) Run(run func(_a0 *node.Node)) *Tree_DeleteBlob_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*node.Node))
})
return _c
}
func (_c *Tree_DeleteBlob_Call) Return(_a0 error) *Tree_DeleteBlob_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Tree_DeleteBlob_Call) RunAndReturn(run func(*node.Node) error) *Tree_DeleteBlob_Call {
_c.Call.Return(run)
return _c
}
// GetMD provides a mock function with given fields: ctx, _a1
func (_m *Tree) GetMD(ctx context.Context, _a1 *node.Node) (fs.FileInfo, error) {
ret := _m.Called(ctx, _a1)
if len(ret) == 0 {
panic("no return value specified for GetMD")
}
var r0 fs.FileInfo
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *node.Node) (fs.FileInfo, error)); ok {
return rf(ctx, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *node.Node) fs.FileInfo); ok {
r0 = rf(ctx, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(fs.FileInfo)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *node.Node) error); ok {
r1 = rf(ctx, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Tree_GetMD_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMD'
type Tree_GetMD_Call struct {
*mock.Call
}
// GetMD is a helper method to define mock.On call
// - ctx context.Context
// - _a1 *node.Node
func (_e *Tree_Expecter) GetMD(ctx interface{}, _a1 interface{}) *Tree_GetMD_Call {
return &Tree_GetMD_Call{Call: _e.mock.On("GetMD", ctx, _a1)}
}
func (_c *Tree_GetMD_Call) Run(run func(ctx context.Context, _a1 *node.Node)) *Tree_GetMD_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*node.Node))
})
return _c
}
func (_c *Tree_GetMD_Call) Return(_a0 fs.FileInfo, _a1 error) *Tree_GetMD_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Tree_GetMD_Call) RunAndReturn(run func(context.Context, *node.Node) (fs.FileInfo, error)) *Tree_GetMD_Call {
_c.Call.Return(run)
return _c
}
// ListFolder provides a mock function with given fields: ctx, _a1
func (_m *Tree) ListFolder(ctx context.Context, _a1 *node.Node) ([]*node.Node, error) {
ret := _m.Called(ctx, _a1)
if len(ret) == 0 {
panic("no return value specified for ListFolder")
}
var r0 []*node.Node
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *node.Node) ([]*node.Node, error)); ok {
return rf(ctx, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *node.Node) []*node.Node); ok {
r0 = rf(ctx, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*node.Node)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *node.Node) error); ok {
r1 = rf(ctx, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Tree_ListFolder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListFolder'
type Tree_ListFolder_Call struct {
*mock.Call
}
// ListFolder is a helper method to define mock.On call
// - ctx context.Context
// - _a1 *node.Node
func (_e *Tree_Expecter) ListFolder(ctx interface{}, _a1 interface{}) *Tree_ListFolder_Call {
return &Tree_ListFolder_Call{Call: _e.mock.On("ListFolder", ctx, _a1)}
}
func (_c *Tree_ListFolder_Call) Run(run func(ctx context.Context, _a1 *node.Node)) *Tree_ListFolder_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*node.Node))
})
return _c
}
func (_c *Tree_ListFolder_Call) Return(_a0 []*node.Node, _a1 error) *Tree_ListFolder_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Tree_ListFolder_Call) RunAndReturn(run func(context.Context, *node.Node) ([]*node.Node, error)) *Tree_ListFolder_Call {
_c.Call.Return(run)
return _c
}
// Move provides a mock function with given fields: ctx, oldNode, newNode
func (_m *Tree) Move(ctx context.Context, oldNode *node.Node, newNode *node.Node) error {
ret := _m.Called(ctx, oldNode, newNode)
if len(ret) == 0 {
panic("no return value specified for Move")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *node.Node, *node.Node) error); ok {
r0 = rf(ctx, oldNode, newNode)
} else {
r0 = ret.Error(0)
}
return r0
}
// Tree_Move_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Move'
type Tree_Move_Call struct {
*mock.Call
}
// Move is a helper method to define mock.On call
// - ctx context.Context
// - oldNode *node.Node
// - newNode *node.Node
func (_e *Tree_Expecter) Move(ctx interface{}, oldNode interface{}, newNode interface{}) *Tree_Move_Call {
return &Tree_Move_Call{Call: _e.mock.On("Move", ctx, oldNode, newNode)}
}
func (_c *Tree_Move_Call) Run(run func(ctx context.Context, oldNode *node.Node, newNode *node.Node)) *Tree_Move_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*node.Node), args[2].(*node.Node))
})
return _c
}
func (_c *Tree_Move_Call) Return(err error) *Tree_Move_Call {
_c.Call.Return(err)
return _c
}
func (_c *Tree_Move_Call) RunAndReturn(run func(context.Context, *node.Node, *node.Node) error) *Tree_Move_Call {
_c.Call.Return(run)
return _c
}
// Propagate provides a mock function with given fields: ctx, _a1, sizeDiff
func (_m *Tree) Propagate(ctx context.Context, _a1 *node.Node, sizeDiff int64) error {
ret := _m.Called(ctx, _a1, sizeDiff)
if len(ret) == 0 {
panic("no return value specified for Propagate")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *node.Node, int64) error); ok {
r0 = rf(ctx, _a1, sizeDiff)
} else {
r0 = ret.Error(0)
}
return r0
}
// Tree_Propagate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Propagate'
type Tree_Propagate_Call struct {
*mock.Call
}
// Propagate is a helper method to define mock.On call
// - ctx context.Context
// - _a1 *node.Node
// - sizeDiff int64
func (_e *Tree_Expecter) Propagate(ctx interface{}, _a1 interface{}, sizeDiff interface{}) *Tree_Propagate_Call {
return &Tree_Propagate_Call{Call: _e.mock.On("Propagate", ctx, _a1, sizeDiff)}
}
func (_c *Tree_Propagate_Call) Run(run func(ctx context.Context, _a1 *node.Node, sizeDiff int64)) *Tree_Propagate_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*node.Node), args[2].(int64))
})
return _c
}
func (_c *Tree_Propagate_Call) Return(err error) *Tree_Propagate_Call {
_c.Call.Return(err)
return _c
}
func (_c *Tree_Propagate_Call) RunAndReturn(run func(context.Context, *node.Node, int64) error) *Tree_Propagate_Call {
_c.Call.Return(run)
return _c
}
// PurgeRecycleItemFunc provides a mock function with given fields: ctx, spaceid, key, purgePath
func (_m *Tree) PurgeRecycleItemFunc(ctx context.Context, spaceid string, key string, purgePath string) (*node.Node, func() error, error) {
ret := _m.Called(ctx, spaceid, key, purgePath)
if len(ret) == 0 {
panic("no return value specified for PurgeRecycleItemFunc")
}
var r0 *node.Node
var r1 func() error
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (*node.Node, func() error, error)); ok {
return rf(ctx, spaceid, key, purgePath)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string) *node.Node); ok {
r0 = rf(ctx, spaceid, key, purgePath)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*node.Node)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, string) func() error); ok {
r1 = rf(ctx, spaceid, key, purgePath)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(func() error)
}
}
if rf, ok := ret.Get(2).(func(context.Context, string, string, string) error); ok {
r2 = rf(ctx, spaceid, key, purgePath)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// Tree_PurgeRecycleItemFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PurgeRecycleItemFunc'
type Tree_PurgeRecycleItemFunc_Call struct {
*mock.Call
}
// PurgeRecycleItemFunc is a helper method to define mock.On call
// - ctx context.Context
// - spaceid string
// - key string
// - purgePath string
func (_e *Tree_Expecter) PurgeRecycleItemFunc(ctx interface{}, spaceid interface{}, key interface{}, purgePath interface{}) *Tree_PurgeRecycleItemFunc_Call {
return &Tree_PurgeRecycleItemFunc_Call{Call: _e.mock.On("PurgeRecycleItemFunc", ctx, spaceid, key, purgePath)}
}
func (_c *Tree_PurgeRecycleItemFunc_Call) Run(run func(ctx context.Context, spaceid string, key string, purgePath string)) *Tree_PurgeRecycleItemFunc_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string))
})
return _c
}
func (_c *Tree_PurgeRecycleItemFunc_Call) Return(_a0 *node.Node, _a1 func() error, _a2 error) *Tree_PurgeRecycleItemFunc_Call {
_c.Call.Return(_a0, _a1, _a2)
return _c
}
func (_c *Tree_PurgeRecycleItemFunc_Call) RunAndReturn(run func(context.Context, string, string, string) (*node.Node, func() error, error)) *Tree_PurgeRecycleItemFunc_Call {
_c.Call.Return(run)
return _c
}
// ReadBlob provides a mock function with given fields: _a0
func (_m *Tree) ReadBlob(_a0 *node.Node) (io.ReadCloser, error) {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for ReadBlob")
}
var r0 io.ReadCloser
var r1 error
if rf, ok := ret.Get(0).(func(*node.Node) (io.ReadCloser, error)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(*node.Node) io.ReadCloser); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(io.ReadCloser)
}
}
if rf, ok := ret.Get(1).(func(*node.Node) error); ok {
r1 = rf(_a0)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Tree_ReadBlob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadBlob'
type Tree_ReadBlob_Call struct {
*mock.Call
}
// ReadBlob is a helper method to define mock.On call
// - _a0 *node.Node
func (_e *Tree_Expecter) ReadBlob(_a0 interface{}) *Tree_ReadBlob_Call {
return &Tree_ReadBlob_Call{Call: _e.mock.On("ReadBlob", _a0)}
}
func (_c *Tree_ReadBlob_Call) Run(run func(_a0 *node.Node)) *Tree_ReadBlob_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*node.Node))
})
return _c
}
func (_c *Tree_ReadBlob_Call) Return(_a0 io.ReadCloser, _a1 error) *Tree_ReadBlob_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Tree_ReadBlob_Call) RunAndReturn(run func(*node.Node) (io.ReadCloser, error)) *Tree_ReadBlob_Call {
_c.Call.Return(run)
return _c
}
// RestoreRecycleItemFunc provides a mock function with given fields: ctx, spaceid, key, trashPath, target
func (_m *Tree) RestoreRecycleItemFunc(ctx context.Context, spaceid string, key string, trashPath string, target *node.Node) (*node.Node, *node.Node, func() error, error) {
ret := _m.Called(ctx, spaceid, key, trashPath, target)
if len(ret) == 0 {
panic("no return value specified for RestoreRecycleItemFunc")
}
var r0 *node.Node
var r1 *node.Node
var r2 func() error
var r3 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *node.Node) (*node.Node, *node.Node, func() error, error)); ok {
return rf(ctx, spaceid, key, trashPath, target)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *node.Node) *node.Node); ok {
r0 = rf(ctx, spaceid, key, trashPath, target)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*node.Node)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *node.Node) *node.Node); ok {
r1 = rf(ctx, spaceid, key, trashPath, target)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*node.Node)
}
}
if rf, ok := ret.Get(2).(func(context.Context, string, string, string, *node.Node) func() error); ok {
r2 = rf(ctx, spaceid, key, trashPath, target)
} else {
if ret.Get(2) != nil {
r2 = ret.Get(2).(func() error)
}
}
if rf, ok := ret.Get(3).(func(context.Context, string, string, string, *node.Node) error); ok {
r3 = rf(ctx, spaceid, key, trashPath, target)
} else {
r3 = ret.Error(3)
}
return r0, r1, r2, r3
}
// Tree_RestoreRecycleItemFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestoreRecycleItemFunc'
type Tree_RestoreRecycleItemFunc_Call struct {
*mock.Call
}
// RestoreRecycleItemFunc is a helper method to define mock.On call
// - ctx context.Context
// - spaceid string
// - key string
// - trashPath string
// - target *node.Node
func (_e *Tree_Expecter) RestoreRecycleItemFunc(ctx interface{}, spaceid interface{}, key interface{}, trashPath interface{}, target interface{}) *Tree_RestoreRecycleItemFunc_Call {
return &Tree_RestoreRecycleItemFunc_Call{Call: _e.mock.On("RestoreRecycleItemFunc", ctx, spaceid, key, trashPath, target)}
}
func (_c *Tree_RestoreRecycleItemFunc_Call) Run(run func(ctx context.Context, spaceid string, key string, trashPath string, target *node.Node)) *Tree_RestoreRecycleItemFunc_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(*node.Node))
})
return _c
}
func (_c *Tree_RestoreRecycleItemFunc_Call) Return(_a0 *node.Node, _a1 *node.Node, _a2 func() error, _a3 error) *Tree_RestoreRecycleItemFunc_Call {
_c.Call.Return(_a0, _a1, _a2, _a3)
return _c
}
func (_c *Tree_RestoreRecycleItemFunc_Call) RunAndReturn(run func(context.Context, string, string, string, *node.Node) (*node.Node, *node.Node, func() error, error)) *Tree_RestoreRecycleItemFunc_Call {
_c.Call.Return(run)
return _c
}
// Setup provides a mock function with given fields:
func (_m *Tree) Setup() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Setup")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// Tree_Setup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Setup'
type Tree_Setup_Call struct {
*mock.Call
}
// Setup is a helper method to define mock.On call
func (_e *Tree_Expecter) Setup() *Tree_Setup_Call {
return &Tree_Setup_Call{Call: _e.mock.On("Setup")}
}
func (_c *Tree_Setup_Call) Run(run func()) *Tree_Setup_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *Tree_Setup_Call) Return(_a0 error) *Tree_Setup_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Tree_Setup_Call) RunAndReturn(run func() error) *Tree_Setup_Call {
_c.Call.Return(run)
return _c
}
// TouchFile provides a mock function with given fields: ctx, _a1, markprocessing, mtime
func (_m *Tree) TouchFile(ctx context.Context, _a1 *node.Node, markprocessing bool, mtime string) error {
ret := _m.Called(ctx, _a1, markprocessing, mtime)
if len(ret) == 0 {
panic("no return value specified for TouchFile")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *node.Node, bool, string) error); ok {
r0 = rf(ctx, _a1, markprocessing, mtime)
} else {
r0 = ret.Error(0)
}
return r0
}
// Tree_TouchFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TouchFile'
type Tree_TouchFile_Call struct {
*mock.Call
}
// TouchFile is a helper method to define mock.On call
// - ctx context.Context
// - _a1 *node.Node
// - markprocessing bool
// - mtime string
func (_e *Tree_Expecter) TouchFile(ctx interface{}, _a1 interface{}, markprocessing interface{}, mtime interface{}) *Tree_TouchFile_Call {
return &Tree_TouchFile_Call{Call: _e.mock.On("TouchFile", ctx, _a1, markprocessing, mtime)}
}
func (_c *Tree_TouchFile_Call) Run(run func(ctx context.Context, _a1 *node.Node, markprocessing bool, mtime string)) *Tree_TouchFile_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*node.Node), args[2].(bool), args[3].(string))
})
return _c
}
func (_c *Tree_TouchFile_Call) Return(_a0 error) *Tree_TouchFile_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Tree_TouchFile_Call) RunAndReturn(run func(context.Context, *node.Node, bool, string) error) *Tree_TouchFile_Call {
_c.Call.Return(run)
return _c
}
// WriteBlob provides a mock function with given fields: _a0, source
func (_m *Tree) WriteBlob(_a0 *node.Node, source string) error {
ret := _m.Called(_a0, source)
if len(ret) == 0 {
panic("no return value specified for WriteBlob")
}
var r0 error
if rf, ok := ret.Get(0).(func(*node.Node, string) error); ok {
r0 = rf(_a0, source)
} else {
r0 = ret.Error(0)
}
return r0
}
// Tree_WriteBlob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteBlob'
type Tree_WriteBlob_Call struct {
*mock.Call
}
// WriteBlob is a helper method to define mock.On call
// - _a0 *node.Node
// - source string
func (_e *Tree_Expecter) WriteBlob(_a0 interface{}, source interface{}) *Tree_WriteBlob_Call {
return &Tree_WriteBlob_Call{Call: _e.mock.On("WriteBlob", _a0, source)}
}
func (_c *Tree_WriteBlob_Call) Run(run func(_a0 *node.Node, source string)) *Tree_WriteBlob_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*node.Node), args[1].(string))
})
return _c
}
func (_c *Tree_WriteBlob_Call) Return(_a0 error) *Tree_WriteBlob_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Tree_WriteBlob_Call) RunAndReturn(run func(*node.Node, string) error) *Tree_WriteBlob_Call {
_c.Call.Return(run)
return _c
}
// NewTree creates a new instance of Tree. 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 NewTree(t interface {
mock.TestingT
Cleanup(func())
}) *Tree {
mock := &Tree{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}