-
Notifications
You must be signed in to change notification settings - Fork 162
/
fake_extractor.go
262 lines (238 loc) · 7.06 KB
/
fake_extractor.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
// Code generated by counterfeiter. DO NOT EDIT.
package fakeblobextract
import (
"sync"
"github.com/cloudfoundry/bosh-cli/installation/blobextract"
)
type FakeExtractor struct {
ChmodExecutablesStub func(string) error
chmodExecutablesMutex sync.RWMutex
chmodExecutablesArgsForCall []struct {
arg1 string
}
chmodExecutablesReturns struct {
result1 error
}
chmodExecutablesReturnsOnCall map[int]struct {
result1 error
}
CleanupStub func(string, string) error
cleanupMutex sync.RWMutex
cleanupArgsForCall []struct {
arg1 string
arg2 string
}
cleanupReturns struct {
result1 error
}
cleanupReturnsOnCall map[int]struct {
result1 error
}
ExtractStub func(string, string, string) error
extractMutex sync.RWMutex
extractArgsForCall []struct {
arg1 string
arg2 string
arg3 string
}
extractReturns struct {
result1 error
}
extractReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeExtractor) ChmodExecutables(arg1 string) error {
fake.chmodExecutablesMutex.Lock()
ret, specificReturn := fake.chmodExecutablesReturnsOnCall[len(fake.chmodExecutablesArgsForCall)]
fake.chmodExecutablesArgsForCall = append(fake.chmodExecutablesArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("ChmodExecutables", []interface{}{arg1})
fake.chmodExecutablesMutex.Unlock()
if fake.ChmodExecutablesStub != nil {
return fake.ChmodExecutablesStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.chmodExecutablesReturns
return fakeReturns.result1
}
func (fake *FakeExtractor) ChmodExecutablesCallCount() int {
fake.chmodExecutablesMutex.RLock()
defer fake.chmodExecutablesMutex.RUnlock()
return len(fake.chmodExecutablesArgsForCall)
}
func (fake *FakeExtractor) ChmodExecutablesCalls(stub func(string) error) {
fake.chmodExecutablesMutex.Lock()
defer fake.chmodExecutablesMutex.Unlock()
fake.ChmodExecutablesStub = stub
}
func (fake *FakeExtractor) ChmodExecutablesArgsForCall(i int) string {
fake.chmodExecutablesMutex.RLock()
defer fake.chmodExecutablesMutex.RUnlock()
argsForCall := fake.chmodExecutablesArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeExtractor) ChmodExecutablesReturns(result1 error) {
fake.chmodExecutablesMutex.Lock()
defer fake.chmodExecutablesMutex.Unlock()
fake.ChmodExecutablesStub = nil
fake.chmodExecutablesReturns = struct {
result1 error
}{result1}
}
func (fake *FakeExtractor) ChmodExecutablesReturnsOnCall(i int, result1 error) {
fake.chmodExecutablesMutex.Lock()
defer fake.chmodExecutablesMutex.Unlock()
fake.ChmodExecutablesStub = nil
if fake.chmodExecutablesReturnsOnCall == nil {
fake.chmodExecutablesReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.chmodExecutablesReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeExtractor) Cleanup(arg1 string, arg2 string) error {
fake.cleanupMutex.Lock()
ret, specificReturn := fake.cleanupReturnsOnCall[len(fake.cleanupArgsForCall)]
fake.cleanupArgsForCall = append(fake.cleanupArgsForCall, struct {
arg1 string
arg2 string
}{arg1, arg2})
fake.recordInvocation("Cleanup", []interface{}{arg1, arg2})
fake.cleanupMutex.Unlock()
if fake.CleanupStub != nil {
return fake.CleanupStub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.cleanupReturns
return fakeReturns.result1
}
func (fake *FakeExtractor) CleanupCallCount() int {
fake.cleanupMutex.RLock()
defer fake.cleanupMutex.RUnlock()
return len(fake.cleanupArgsForCall)
}
func (fake *FakeExtractor) CleanupCalls(stub func(string, string) error) {
fake.cleanupMutex.Lock()
defer fake.cleanupMutex.Unlock()
fake.CleanupStub = stub
}
func (fake *FakeExtractor) CleanupArgsForCall(i int) (string, string) {
fake.cleanupMutex.RLock()
defer fake.cleanupMutex.RUnlock()
argsForCall := fake.cleanupArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeExtractor) CleanupReturns(result1 error) {
fake.cleanupMutex.Lock()
defer fake.cleanupMutex.Unlock()
fake.CleanupStub = nil
fake.cleanupReturns = struct {
result1 error
}{result1}
}
func (fake *FakeExtractor) CleanupReturnsOnCall(i int, result1 error) {
fake.cleanupMutex.Lock()
defer fake.cleanupMutex.Unlock()
fake.CleanupStub = nil
if fake.cleanupReturnsOnCall == nil {
fake.cleanupReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.cleanupReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeExtractor) Extract(arg1 string, arg2 string, arg3 string) error {
fake.extractMutex.Lock()
ret, specificReturn := fake.extractReturnsOnCall[len(fake.extractArgsForCall)]
fake.extractArgsForCall = append(fake.extractArgsForCall, struct {
arg1 string
arg2 string
arg3 string
}{arg1, arg2, arg3})
fake.recordInvocation("Extract", []interface{}{arg1, arg2, arg3})
fake.extractMutex.Unlock()
if fake.ExtractStub != nil {
return fake.ExtractStub(arg1, arg2, arg3)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.extractReturns
return fakeReturns.result1
}
func (fake *FakeExtractor) ExtractCallCount() int {
fake.extractMutex.RLock()
defer fake.extractMutex.RUnlock()
return len(fake.extractArgsForCall)
}
func (fake *FakeExtractor) ExtractCalls(stub func(string, string, string) error) {
fake.extractMutex.Lock()
defer fake.extractMutex.Unlock()
fake.ExtractStub = stub
}
func (fake *FakeExtractor) ExtractArgsForCall(i int) (string, string, string) {
fake.extractMutex.RLock()
defer fake.extractMutex.RUnlock()
argsForCall := fake.extractArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}
func (fake *FakeExtractor) ExtractReturns(result1 error) {
fake.extractMutex.Lock()
defer fake.extractMutex.Unlock()
fake.ExtractStub = nil
fake.extractReturns = struct {
result1 error
}{result1}
}
func (fake *FakeExtractor) ExtractReturnsOnCall(i int, result1 error) {
fake.extractMutex.Lock()
defer fake.extractMutex.Unlock()
fake.ExtractStub = nil
if fake.extractReturnsOnCall == nil {
fake.extractReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.extractReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeExtractor) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.chmodExecutablesMutex.RLock()
defer fake.chmodExecutablesMutex.RUnlock()
fake.cleanupMutex.RLock()
defer fake.cleanupMutex.RUnlock()
fake.extractMutex.RLock()
defer fake.extractMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeExtractor) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ blobextract.Extractor = new(FakeExtractor)