-
Notifications
You must be signed in to change notification settings - Fork 1
/
clientexpectations_gen.go
1100 lines (953 loc) · 31 KB
/
clientexpectations_gen.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
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* This file is auto-generated. Do not edit it! */
package kivikmock
import (
"context"
"fmt"
"reflect"
"time"
"github.com/go-kivik/kivik/v4/driver"
)
var _ = &driver.Attachment{}
var _ = reflect.Int
// ExpectedAllDBs represents an expectation for a call to AllDBs().
type ExpectedAllDBs struct {
commonExpectation
callback func(ctx context.Context, options map[string]interface{}) ([]string, error)
ret0 []string
}
// WithOptions sets the expected options for the call to AllDBs().
func (e *ExpectedAllDBs) WithOptions(options map[string]interface{}) *ExpectedAllDBs {
e.options = options
return e
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedAllDBs) WillExecute(cb func(ctx context.Context, options map[string]interface{}) ([]string, error)) *ExpectedAllDBs {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to AllDBs().
func (e *ExpectedAllDBs) WillReturn(ret0 []string) *ExpectedAllDBs {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to AllDBs().
func (e *ExpectedAllDBs) WillReturnError(err error) *ExpectedAllDBs {
e.err = err
return e
}
// WillDelay causes the call to AllDBs() to delay.
func (e *ExpectedAllDBs) WillDelay(delay time.Duration) *ExpectedAllDBs {
e.delay = delay
return e
}
func (e *ExpectedAllDBs) met(_ expectation) bool {
return true
}
func (e *ExpectedAllDBs) method(v bool) string {
if !v {
return "AllDBs()"
}
options := defaultOptionPlaceholder
if e.options != nil {
options = fmt.Sprintf("%v", e.options)
}
return fmt.Sprintf("AllDBs(ctx, %s)", options)
}
// ExpectedClose represents an expectation for a call to Close().
type ExpectedClose struct {
commonExpectation
callback func() error
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedClose) WillExecute(cb func() error) *ExpectedClose {
e.callback = cb
return e
}
// WillReturnError sets the error value that will be returned by the call to Close().
func (e *ExpectedClose) WillReturnError(err error) *ExpectedClose {
e.err = err
return e
}
func (e *ExpectedClose) met(_ expectation) bool {
return true
}
func (e *ExpectedClose) method(v bool) string {
if !v {
return "Close()"
}
return fmt.Sprintf("Close()")
}
// ExpectedClusterSetup represents an expectation for a call to ClusterSetup().
type ExpectedClusterSetup struct {
commonExpectation
callback func(ctx context.Context, arg0 interface{}) error
arg0 interface{}
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedClusterSetup) WillExecute(cb func(ctx context.Context, arg0 interface{}) error) *ExpectedClusterSetup {
e.callback = cb
return e
}
// WillReturnError sets the error value that will be returned by the call to ClusterSetup().
func (e *ExpectedClusterSetup) WillReturnError(err error) *ExpectedClusterSetup {
e.err = err
return e
}
// WillDelay causes the call to ClusterSetup() to delay.
func (e *ExpectedClusterSetup) WillDelay(delay time.Duration) *ExpectedClusterSetup {
e.delay = delay
return e
}
func (e *ExpectedClusterSetup) met(ex expectation) bool {
exp := ex.(*ExpectedClusterSetup)
if exp.arg0 != nil && !jsonMeets(exp.arg0, e.arg0) {
return false
}
return true
}
func (e *ExpectedClusterSetup) method(v bool) string {
if !v {
return "ClusterSetup()"
}
arg0 := "?"
if e.arg0 != nil {
arg0 = fmt.Sprintf("%v", e.arg0)
}
return fmt.Sprintf("ClusterSetup(ctx, %s)", arg0)
}
// ExpectedClusterStatus represents an expectation for a call to ClusterStatus().
type ExpectedClusterStatus struct {
commonExpectation
callback func(ctx context.Context, options map[string]interface{}) (string, error)
ret0 string
}
// WithOptions sets the expected options for the call to ClusterStatus().
func (e *ExpectedClusterStatus) WithOptions(options map[string]interface{}) *ExpectedClusterStatus {
e.options = options
return e
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedClusterStatus) WillExecute(cb func(ctx context.Context, options map[string]interface{}) (string, error)) *ExpectedClusterStatus {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to ClusterStatus().
func (e *ExpectedClusterStatus) WillReturn(ret0 string) *ExpectedClusterStatus {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to ClusterStatus().
func (e *ExpectedClusterStatus) WillReturnError(err error) *ExpectedClusterStatus {
e.err = err
return e
}
// WillDelay causes the call to ClusterStatus() to delay.
func (e *ExpectedClusterStatus) WillDelay(delay time.Duration) *ExpectedClusterStatus {
e.delay = delay
return e
}
func (e *ExpectedClusterStatus) met(_ expectation) bool {
return true
}
func (e *ExpectedClusterStatus) method(v bool) string {
if !v {
return "ClusterStatus()"
}
options := defaultOptionPlaceholder
if e.options != nil {
options = fmt.Sprintf("%v", e.options)
}
return fmt.Sprintf("ClusterStatus(ctx, %s)", options)
}
// ExpectedConfigValue represents an expectation for a call to ConfigValue().
type ExpectedConfigValue struct {
commonExpectation
callback func(ctx context.Context, arg0 string, arg1 string, arg2 string) (string, error)
arg0 string
arg1 string
arg2 string
ret0 string
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedConfigValue) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 string) (string, error)) *ExpectedConfigValue {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to ConfigValue().
func (e *ExpectedConfigValue) WillReturn(ret0 string) *ExpectedConfigValue {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to ConfigValue().
func (e *ExpectedConfigValue) WillReturnError(err error) *ExpectedConfigValue {
e.err = err
return e
}
// WillDelay causes the call to ConfigValue() to delay.
func (e *ExpectedConfigValue) WillDelay(delay time.Duration) *ExpectedConfigValue {
e.delay = delay
return e
}
func (e *ExpectedConfigValue) met(ex expectation) bool {
exp := ex.(*ExpectedConfigValue)
if exp.arg0 != "" && exp.arg0 != e.arg0 {
return false
}
if exp.arg1 != "" && exp.arg1 != e.arg1 {
return false
}
if exp.arg2 != "" && exp.arg2 != e.arg2 {
return false
}
return true
}
func (e *ExpectedConfigValue) method(v bool) string {
if !v {
return "ConfigValue()"
}
arg0, arg1, arg2 := "?", "?", "?"
if e.arg0 != "" {
arg0 = fmt.Sprintf("%q", e.arg0)
}
if e.arg1 != "" {
arg1 = fmt.Sprintf("%q", e.arg1)
}
if e.arg2 != "" {
arg2 = fmt.Sprintf("%q", e.arg2)
}
return fmt.Sprintf("ConfigValue(ctx, %s, %s, %s)", arg0, arg1, arg2)
}
// ExpectedDBExists represents an expectation for a call to DBExists().
type ExpectedDBExists struct {
commonExpectation
callback func(ctx context.Context, arg0 string, options map[string]interface{}) (bool, error)
arg0 string
ret0 bool
}
// WithOptions sets the expected options for the call to DBExists().
func (e *ExpectedDBExists) WithOptions(options map[string]interface{}) *ExpectedDBExists {
e.options = options
return e
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedDBExists) WillExecute(cb func(ctx context.Context, arg0 string, options map[string]interface{}) (bool, error)) *ExpectedDBExists {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to DBExists().
func (e *ExpectedDBExists) WillReturn(ret0 bool) *ExpectedDBExists {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to DBExists().
func (e *ExpectedDBExists) WillReturnError(err error) *ExpectedDBExists {
e.err = err
return e
}
// WillDelay causes the call to DBExists() to delay.
func (e *ExpectedDBExists) WillDelay(delay time.Duration) *ExpectedDBExists {
e.delay = delay
return e
}
func (e *ExpectedDBExists) met(ex expectation) bool {
exp := ex.(*ExpectedDBExists)
if exp.arg0 != "" && exp.arg0 != e.arg0 {
return false
}
return true
}
func (e *ExpectedDBExists) method(v bool) string {
if !v {
return "DBExists()"
}
arg0, options := "?", defaultOptionPlaceholder
if e.arg0 != "" {
arg0 = fmt.Sprintf("%q", e.arg0)
}
if e.options != nil {
options = fmt.Sprintf("%v", e.options)
}
return fmt.Sprintf("DBExists(ctx, %s, %s)", arg0, options)
}
// ExpectedDeleteConfigKey represents an expectation for a call to DeleteConfigKey().
type ExpectedDeleteConfigKey struct {
commonExpectation
callback func(ctx context.Context, arg0 string, arg1 string, arg2 string) (string, error)
arg0 string
arg1 string
arg2 string
ret0 string
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedDeleteConfigKey) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 string) (string, error)) *ExpectedDeleteConfigKey {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to DeleteConfigKey().
func (e *ExpectedDeleteConfigKey) WillReturn(ret0 string) *ExpectedDeleteConfigKey {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to DeleteConfigKey().
func (e *ExpectedDeleteConfigKey) WillReturnError(err error) *ExpectedDeleteConfigKey {
e.err = err
return e
}
// WillDelay causes the call to DeleteConfigKey() to delay.
func (e *ExpectedDeleteConfigKey) WillDelay(delay time.Duration) *ExpectedDeleteConfigKey {
e.delay = delay
return e
}
func (e *ExpectedDeleteConfigKey) met(ex expectation) bool {
exp := ex.(*ExpectedDeleteConfigKey)
if exp.arg0 != "" && exp.arg0 != e.arg0 {
return false
}
if exp.arg1 != "" && exp.arg1 != e.arg1 {
return false
}
if exp.arg2 != "" && exp.arg2 != e.arg2 {
return false
}
return true
}
func (e *ExpectedDeleteConfigKey) method(v bool) string {
if !v {
return "DeleteConfigKey()"
}
arg0, arg1, arg2 := "?", "?", "?"
if e.arg0 != "" {
arg0 = fmt.Sprintf("%q", e.arg0)
}
if e.arg1 != "" {
arg1 = fmt.Sprintf("%q", e.arg1)
}
if e.arg2 != "" {
arg2 = fmt.Sprintf("%q", e.arg2)
}
return fmt.Sprintf("DeleteConfigKey(ctx, %s, %s, %s)", arg0, arg1, arg2)
}
// ExpectedDestroyDB represents an expectation for a call to DestroyDB().
type ExpectedDestroyDB struct {
commonExpectation
callback func(ctx context.Context, arg0 string, options map[string]interface{}) error
arg0 string
}
// WithOptions sets the expected options for the call to DestroyDB().
func (e *ExpectedDestroyDB) WithOptions(options map[string]interface{}) *ExpectedDestroyDB {
e.options = options
return e
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedDestroyDB) WillExecute(cb func(ctx context.Context, arg0 string, options map[string]interface{}) error) *ExpectedDestroyDB {
e.callback = cb
return e
}
// WillReturnError sets the error value that will be returned by the call to DestroyDB().
func (e *ExpectedDestroyDB) WillReturnError(err error) *ExpectedDestroyDB {
e.err = err
return e
}
// WillDelay causes the call to DestroyDB() to delay.
func (e *ExpectedDestroyDB) WillDelay(delay time.Duration) *ExpectedDestroyDB {
e.delay = delay
return e
}
func (e *ExpectedDestroyDB) met(ex expectation) bool {
exp := ex.(*ExpectedDestroyDB)
if exp.arg0 != "" && exp.arg0 != e.arg0 {
return false
}
return true
}
func (e *ExpectedDestroyDB) method(v bool) string {
if !v {
return "DestroyDB()"
}
arg0, options := "?", defaultOptionPlaceholder
if e.arg0 != "" {
arg0 = fmt.Sprintf("%q", e.arg0)
}
if e.options != nil {
options = fmt.Sprintf("%v", e.options)
}
return fmt.Sprintf("DestroyDB(ctx, %s, %s)", arg0, options)
}
// ExpectedPing represents an expectation for a call to Ping().
type ExpectedPing struct {
commonExpectation
callback func(ctx context.Context) (bool, error)
ret0 bool
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedPing) WillExecute(cb func(ctx context.Context) (bool, error)) *ExpectedPing {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to Ping().
func (e *ExpectedPing) WillReturn(ret0 bool) *ExpectedPing {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to Ping().
func (e *ExpectedPing) WillReturnError(err error) *ExpectedPing {
e.err = err
return e
}
// WillDelay causes the call to Ping() to delay.
func (e *ExpectedPing) WillDelay(delay time.Duration) *ExpectedPing {
e.delay = delay
return e
}
func (e *ExpectedPing) met(_ expectation) bool {
return true
}
func (e *ExpectedPing) method(v bool) string {
if !v {
return "Ping()"
}
return fmt.Sprintf("Ping(ctx)")
}
// ExpectedSetConfigValue represents an expectation for a call to SetConfigValue().
type ExpectedSetConfigValue struct {
commonExpectation
callback func(ctx context.Context, arg0 string, arg1 string, arg2 string, arg3 string) (string, error)
arg0 string
arg1 string
arg2 string
arg3 string
ret0 string
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedSetConfigValue) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 string, arg3 string) (string, error)) *ExpectedSetConfigValue {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to SetConfigValue().
func (e *ExpectedSetConfigValue) WillReturn(ret0 string) *ExpectedSetConfigValue {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to SetConfigValue().
func (e *ExpectedSetConfigValue) WillReturnError(err error) *ExpectedSetConfigValue {
e.err = err
return e
}
// WillDelay causes the call to SetConfigValue() to delay.
func (e *ExpectedSetConfigValue) WillDelay(delay time.Duration) *ExpectedSetConfigValue {
e.delay = delay
return e
}
func (e *ExpectedSetConfigValue) met(ex expectation) bool {
exp := ex.(*ExpectedSetConfigValue)
if exp.arg0 != "" && exp.arg0 != e.arg0 {
return false
}
if exp.arg1 != "" && exp.arg1 != e.arg1 {
return false
}
if exp.arg2 != "" && exp.arg2 != e.arg2 {
return false
}
if exp.arg3 != "" && exp.arg3 != e.arg3 {
return false
}
return true
}
func (e *ExpectedSetConfigValue) method(v bool) string {
if !v {
return "SetConfigValue()"
}
arg0, arg1, arg2, arg3 := "?", "?", "?", "?"
if e.arg0 != "" {
arg0 = fmt.Sprintf("%q", e.arg0)
}
if e.arg1 != "" {
arg1 = fmt.Sprintf("%q", e.arg1)
}
if e.arg2 != "" {
arg2 = fmt.Sprintf("%q", e.arg2)
}
if e.arg3 != "" {
arg3 = fmt.Sprintf("%q", e.arg3)
}
return fmt.Sprintf("SetConfigValue(ctx, %s, %s, %s, %s)", arg0, arg1, arg2, arg3)
}
// ExpectedConfig represents an expectation for a call to Config().
type ExpectedConfig struct {
commonExpectation
callback func(ctx context.Context, arg0 string) (driver.Config, error)
arg0 string
ret0 driver.Config
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedConfig) WillExecute(cb func(ctx context.Context, arg0 string) (driver.Config, error)) *ExpectedConfig {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to Config().
func (e *ExpectedConfig) WillReturn(ret0 driver.Config) *ExpectedConfig {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to Config().
func (e *ExpectedConfig) WillReturnError(err error) *ExpectedConfig {
e.err = err
return e
}
// WillDelay causes the call to Config() to delay.
func (e *ExpectedConfig) WillDelay(delay time.Duration) *ExpectedConfig {
e.delay = delay
return e
}
func (e *ExpectedConfig) met(ex expectation) bool {
exp := ex.(*ExpectedConfig)
if exp.arg0 != "" && exp.arg0 != e.arg0 {
return false
}
return true
}
func (e *ExpectedConfig) method(v bool) string {
if !v {
return "Config()"
}
arg0 := "?"
if e.arg0 != "" {
arg0 = fmt.Sprintf("%q", e.arg0)
}
return fmt.Sprintf("Config(ctx, %s)", arg0)
}
// ExpectedConfigSection represents an expectation for a call to ConfigSection().
type ExpectedConfigSection struct {
commonExpectation
callback func(ctx context.Context, arg0 string, arg1 string) (driver.ConfigSection, error)
arg0 string
arg1 string
ret0 driver.ConfigSection
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedConfigSection) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string) (driver.ConfigSection, error)) *ExpectedConfigSection {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to ConfigSection().
func (e *ExpectedConfigSection) WillReturn(ret0 driver.ConfigSection) *ExpectedConfigSection {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to ConfigSection().
func (e *ExpectedConfigSection) WillReturnError(err error) *ExpectedConfigSection {
e.err = err
return e
}
// WillDelay causes the call to ConfigSection() to delay.
func (e *ExpectedConfigSection) WillDelay(delay time.Duration) *ExpectedConfigSection {
e.delay = delay
return e
}
func (e *ExpectedConfigSection) met(ex expectation) bool {
exp := ex.(*ExpectedConfigSection)
if exp.arg0 != "" && exp.arg0 != e.arg0 {
return false
}
if exp.arg1 != "" && exp.arg1 != e.arg1 {
return false
}
return true
}
func (e *ExpectedConfigSection) method(v bool) string {
if !v {
return "ConfigSection()"
}
arg0, arg1 := "?", "?"
if e.arg0 != "" {
arg0 = fmt.Sprintf("%q", e.arg0)
}
if e.arg1 != "" {
arg1 = fmt.Sprintf("%q", e.arg1)
}
return fmt.Sprintf("ConfigSection(ctx, %s, %s)", arg0, arg1)
}
// ExpectedDB represents an expectation for a call to DB().
type ExpectedDB struct {
commonExpectation
callback func(arg0 string, options map[string]interface{}) (driver.DB, error)
arg0 string
ret0 *DB
}
// WithOptions sets the expected options for the call to DB().
func (e *ExpectedDB) WithOptions(options map[string]interface{}) *ExpectedDB {
e.options = options
return e
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedDB) WillExecute(cb func(arg0 string, options map[string]interface{}) (driver.DB, error)) *ExpectedDB {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to DB().
func (e *ExpectedDB) WillReturn(ret0 *DB) *ExpectedDB {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to DB().
func (e *ExpectedDB) WillReturnError(err error) *ExpectedDB {
e.err = err
return e
}
func (e *ExpectedDB) met(ex expectation) bool {
exp := ex.(*ExpectedDB)
if exp.arg0 != "" && exp.arg0 != e.arg0 {
return false
}
return true
}
func (e *ExpectedDB) method(v bool) string {
if !v {
return "DB()"
}
arg0, options := "?", defaultOptionPlaceholder
if e.arg0 != "" {
arg0 = fmt.Sprintf("%q", e.arg0)
}
if e.options != nil {
options = fmt.Sprintf("%v", e.options)
}
return fmt.Sprintf("DB(%s, %s)", arg0, options)
}
// ExpectedDBUpdates represents an expectation for a call to DBUpdates().
type ExpectedDBUpdates struct {
commonExpectation
callback func(ctx context.Context, options map[string]interface{}) (driver.DBUpdates, error)
ret0 *Updates
}
// WithOptions sets the expected options for the call to DBUpdates().
func (e *ExpectedDBUpdates) WithOptions(options map[string]interface{}) *ExpectedDBUpdates {
e.options = options
return e
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedDBUpdates) WillExecute(cb func(ctx context.Context, options map[string]interface{}) (driver.DBUpdates, error)) *ExpectedDBUpdates {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to DBUpdates().
func (e *ExpectedDBUpdates) WillReturn(ret0 *Updates) *ExpectedDBUpdates {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to DBUpdates().
func (e *ExpectedDBUpdates) WillReturnError(err error) *ExpectedDBUpdates {
e.err = err
return e
}
// WillDelay causes the call to DBUpdates() to delay.
func (e *ExpectedDBUpdates) WillDelay(delay time.Duration) *ExpectedDBUpdates {
e.delay = delay
return e
}
func (e *ExpectedDBUpdates) met(_ expectation) bool {
return true
}
func (e *ExpectedDBUpdates) method(v bool) string {
if !v {
return "DBUpdates()"
}
options := defaultOptionPlaceholder
if e.options != nil {
options = fmt.Sprintf("%v", e.options)
}
return fmt.Sprintf("DBUpdates(ctx, %s)", options)
}
// ExpectedDBsStats represents an expectation for a call to DBsStats().
type ExpectedDBsStats struct {
commonExpectation
callback func(ctx context.Context, arg0 []string) ([]*driver.DBStats, error)
arg0 []string
ret0 []*driver.DBStats
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedDBsStats) WillExecute(cb func(ctx context.Context, arg0 []string) ([]*driver.DBStats, error)) *ExpectedDBsStats {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to DBsStats().
func (e *ExpectedDBsStats) WillReturn(ret0 []*driver.DBStats) *ExpectedDBsStats {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to DBsStats().
func (e *ExpectedDBsStats) WillReturnError(err error) *ExpectedDBsStats {
e.err = err
return e
}
// WillDelay causes the call to DBsStats() to delay.
func (e *ExpectedDBsStats) WillDelay(delay time.Duration) *ExpectedDBsStats {
e.delay = delay
return e
}
func (e *ExpectedDBsStats) met(ex expectation) bool {
exp := ex.(*ExpectedDBsStats)
if exp.arg0 != nil && !reflect.DeepEqual(exp.arg0, e.arg0) {
return false
}
return true
}
func (e *ExpectedDBsStats) method(v bool) string {
if !v {
return "DBsStats()"
}
arg0 := "?"
if e.arg0 != nil {
arg0 = fmt.Sprintf("%v", e.arg0)
}
return fmt.Sprintf("DBsStats(ctx, %s)", arg0)
}
// ExpectedGetReplications represents an expectation for a call to GetReplications().
type ExpectedGetReplications struct {
commonExpectation
callback func(ctx context.Context, options map[string]interface{}) ([]driver.Replication, error)
ret0 []*Replication
}
// WithOptions sets the expected options for the call to GetReplications().
func (e *ExpectedGetReplications) WithOptions(options map[string]interface{}) *ExpectedGetReplications {
e.options = options
return e
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedGetReplications) WillExecute(cb func(ctx context.Context, options map[string]interface{}) ([]driver.Replication, error)) *ExpectedGetReplications {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to GetReplications().
func (e *ExpectedGetReplications) WillReturn(ret0 []*Replication) *ExpectedGetReplications {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to GetReplications().
func (e *ExpectedGetReplications) WillReturnError(err error) *ExpectedGetReplications {
e.err = err
return e
}
// WillDelay causes the call to GetReplications() to delay.
func (e *ExpectedGetReplications) WillDelay(delay time.Duration) *ExpectedGetReplications {
e.delay = delay
return e
}
func (e *ExpectedGetReplications) met(_ expectation) bool {
return true
}
func (e *ExpectedGetReplications) method(v bool) string {
if !v {
return "GetReplications()"
}
options := defaultOptionPlaceholder
if e.options != nil {
options = fmt.Sprintf("%v", e.options)
}
return fmt.Sprintf("GetReplications(ctx, %s)", options)
}
// ExpectedMembership represents an expectation for a call to Membership().
type ExpectedMembership struct {
commonExpectation
callback func(ctx context.Context) (*driver.ClusterMembership, error)
ret0 *driver.ClusterMembership
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedMembership) WillExecute(cb func(ctx context.Context) (*driver.ClusterMembership, error)) *ExpectedMembership {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to Membership().
func (e *ExpectedMembership) WillReturn(ret0 *driver.ClusterMembership) *ExpectedMembership {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to Membership().
func (e *ExpectedMembership) WillReturnError(err error) *ExpectedMembership {
e.err = err
return e
}
// WillDelay causes the call to Membership() to delay.
func (e *ExpectedMembership) WillDelay(delay time.Duration) *ExpectedMembership {
e.delay = delay
return e
}
func (e *ExpectedMembership) met(_ expectation) bool {
return true
}
func (e *ExpectedMembership) method(v bool) string {
if !v {
return "Membership()"
}
return fmt.Sprintf("Membership(ctx)")
}
// ExpectedReplicate represents an expectation for a call to Replicate().
type ExpectedReplicate struct {
commonExpectation
callback func(ctx context.Context, arg0 string, arg1 string, options map[string]interface{}) (driver.Replication, error)
arg0 string
arg1 string
ret0 *Replication
}
// WithOptions sets the expected options for the call to Replicate().
func (e *ExpectedReplicate) WithOptions(options map[string]interface{}) *ExpectedReplicate {
e.options = options
return e
}
// WillExecute sets a callback function to be called with any inputs to the
// original function. Any values returned by the callback will be returned as
// if generated by the driver.
func (e *ExpectedReplicate) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options map[string]interface{}) (driver.Replication, error)) *ExpectedReplicate {
e.callback = cb
return e
}
// WillReturn sets the values that will be returned by the call to Replicate().
func (e *ExpectedReplicate) WillReturn(ret0 *Replication) *ExpectedReplicate {
e.ret0 = ret0
return e
}
// WillReturnError sets the error value that will be returned by the call to Replicate().
func (e *ExpectedReplicate) WillReturnError(err error) *ExpectedReplicate {
e.err = err
return e
}
// WillDelay causes the call to Replicate() to delay.
func (e *ExpectedReplicate) WillDelay(delay time.Duration) *ExpectedReplicate {
e.delay = delay
return e
}
func (e *ExpectedReplicate) met(ex expectation) bool {
exp := ex.(*ExpectedReplicate)
if exp.arg0 != "" && exp.arg0 != e.arg0 {
return false
}
if exp.arg1 != "" && exp.arg1 != e.arg1 {
return false
}
return true
}
func (e *ExpectedReplicate) method(v bool) string {
if !v {
return "Replicate()"
}