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
|
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"time"
"cloud.google.com/go/spanner"
"github.com/google/syzkaller/pkg/coveragedb/spannerclient"
mock "github.com/stretchr/testify/mock"
)
// NewSpannerClient creates a new instance of SpannerClient. 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 NewSpannerClient(t interface {
mock.TestingT
Cleanup(func())
}) *SpannerClient {
mock := &SpannerClient{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// SpannerClient is an autogenerated mock type for the SpannerClient type
type SpannerClient struct {
mock.Mock
}
type SpannerClient_Expecter struct {
mock *mock.Mock
}
func (_m *SpannerClient) EXPECT() *SpannerClient_Expecter {
return &SpannerClient_Expecter{mock: &_m.Mock}
}
// Apply provides a mock function for the type SpannerClient
func (_mock *SpannerClient) Apply(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption) (time.Time, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, ms, opts)
} else {
tmpRet = _mock.Called(ctx, ms)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for Apply")
}
var r0 time.Time
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) (time.Time, error)); ok {
return returnFunc(ctx, ms, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) time.Time); ok {
r0 = returnFunc(ctx, ms, opts...)
} else {
r0 = ret.Get(0).(time.Time)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) error); ok {
r1 = returnFunc(ctx, ms, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SpannerClient_Apply_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Apply'
type SpannerClient_Apply_Call struct {
*mock.Call
}
// Apply is a helper method to define mock.On call
// - ctx context.Context
// - ms []*spanner.Mutation
// - opts ...spanner.ApplyOption
func (_e *SpannerClient_Expecter) Apply(ctx interface{}, ms interface{}, opts ...interface{}) *SpannerClient_Apply_Call {
return &SpannerClient_Apply_Call{Call: _e.mock.On("Apply",
append([]interface{}{ctx, ms}, opts...)...)}
}
func (_c *SpannerClient_Apply_Call) Run(run func(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption)) *SpannerClient_Apply_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 []*spanner.Mutation
if args[1] != nil {
arg1 = args[1].([]*spanner.Mutation)
}
var arg2 []spanner.ApplyOption
var variadicArgs []spanner.ApplyOption
if len(args) > 2 {
variadicArgs = args[2].([]spanner.ApplyOption)
}
arg2 = variadicArgs
run(
arg0,
arg1,
arg2...,
)
})
return _c
}
func (_c *SpannerClient_Apply_Call) Return(commitTimestamp time.Time, err error) *SpannerClient_Apply_Call {
_c.Call.Return(commitTimestamp, err)
return _c
}
func (_c *SpannerClient_Apply_Call) RunAndReturn(run func(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption) (time.Time, error)) *SpannerClient_Apply_Call {
_c.Call.Return(run)
return _c
}
// Close provides a mock function for the type SpannerClient
func (_mock *SpannerClient) Close() {
_mock.Called()
return
}
// SpannerClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type SpannerClient_Close_Call struct {
*mock.Call
}
// Close is a helper method to define mock.On call
func (_e *SpannerClient_Expecter) Close() *SpannerClient_Close_Call {
return &SpannerClient_Close_Call{Call: _e.mock.On("Close")}
}
func (_c *SpannerClient_Close_Call) Run(run func()) *SpannerClient_Close_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *SpannerClient_Close_Call) Return() *SpannerClient_Close_Call {
_c.Call.Return()
return _c
}
func (_c *SpannerClient_Close_Call) RunAndReturn(run func()) *SpannerClient_Close_Call {
_c.Run(run)
return _c
}
// Single provides a mock function for the type SpannerClient
func (_mock *SpannerClient) Single() spannerclient.ReadOnlyTransaction {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Single")
}
var r0 spannerclient.ReadOnlyTransaction
if returnFunc, ok := ret.Get(0).(func() spannerclient.ReadOnlyTransaction); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(spannerclient.ReadOnlyTransaction)
}
}
return r0
}
// SpannerClient_Single_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Single'
type SpannerClient_Single_Call struct {
*mock.Call
}
// Single is a helper method to define mock.On call
func (_e *SpannerClient_Expecter) Single() *SpannerClient_Single_Call {
return &SpannerClient_Single_Call{Call: _e.mock.On("Single")}
}
func (_c *SpannerClient_Single_Call) Run(run func()) *SpannerClient_Single_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *SpannerClient_Single_Call) Return(readOnlyTransaction spannerclient.ReadOnlyTransaction) *SpannerClient_Single_Call {
_c.Call.Return(readOnlyTransaction)
return _c
}
func (_c *SpannerClient_Single_Call) RunAndReturn(run func() spannerclient.ReadOnlyTransaction) *SpannerClient_Single_Call {
_c.Call.Return(run)
return _c
}
|