forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_blobs_dir.go
268 lines (241 loc) · 7.12 KB
/
fake_blobs_dir.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
// This file was generated by counterfeiter
package releasedirfakes
import (
"io"
"sync"
"github.com/cloudfoundry/bosh-cli/releasedir"
)
type FakeBlobsDir struct {
InitStub func() error
initMutex sync.RWMutex
initArgsForCall []struct{}
initReturns struct {
result1 error
}
BlobsStub func() ([]releasedir.Blob, error)
blobsMutex sync.RWMutex
blobsArgsForCall []struct{}
blobsReturns struct {
result1 []releasedir.Blob
result2 error
}
SyncBlobsStub func(numOfParallelWorkers int) error
syncBlobsMutex sync.RWMutex
syncBlobsArgsForCall []struct {
numOfParallelWorkers int
}
syncBlobsReturns struct {
result1 error
}
UploadBlobsStub func() error
uploadBlobsMutex sync.RWMutex
uploadBlobsArgsForCall []struct{}
uploadBlobsReturns struct {
result1 error
}
TrackBlobStub func(string, io.ReadCloser) (releasedir.Blob, error)
trackBlobMutex sync.RWMutex
trackBlobArgsForCall []struct {
arg1 string
arg2 io.ReadCloser
}
trackBlobReturns struct {
result1 releasedir.Blob
result2 error
}
UntrackBlobStub func(string) error
untrackBlobMutex sync.RWMutex
untrackBlobArgsForCall []struct {
arg1 string
}
untrackBlobReturns struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeBlobsDir) Init() error {
fake.initMutex.Lock()
fake.initArgsForCall = append(fake.initArgsForCall, struct{}{})
fake.recordInvocation("Init", []interface{}{})
fake.initMutex.Unlock()
if fake.InitStub != nil {
return fake.InitStub()
} else {
return fake.initReturns.result1
}
}
func (fake *FakeBlobsDir) InitCallCount() int {
fake.initMutex.RLock()
defer fake.initMutex.RUnlock()
return len(fake.initArgsForCall)
}
func (fake *FakeBlobsDir) InitReturns(result1 error) {
fake.InitStub = nil
fake.initReturns = struct {
result1 error
}{result1}
}
func (fake *FakeBlobsDir) Blobs() ([]releasedir.Blob, error) {
fake.blobsMutex.Lock()
fake.blobsArgsForCall = append(fake.blobsArgsForCall, struct{}{})
fake.recordInvocation("Blobs", []interface{}{})
fake.blobsMutex.Unlock()
if fake.BlobsStub != nil {
return fake.BlobsStub()
} else {
return fake.blobsReturns.result1, fake.blobsReturns.result2
}
}
func (fake *FakeBlobsDir) BlobsCallCount() int {
fake.blobsMutex.RLock()
defer fake.blobsMutex.RUnlock()
return len(fake.blobsArgsForCall)
}
func (fake *FakeBlobsDir) BlobsReturns(result1 []releasedir.Blob, result2 error) {
fake.BlobsStub = nil
fake.blobsReturns = struct {
result1 []releasedir.Blob
result2 error
}{result1, result2}
}
func (fake *FakeBlobsDir) SyncBlobs(numOfParallelWorkers int) error {
fake.syncBlobsMutex.Lock()
fake.syncBlobsArgsForCall = append(fake.syncBlobsArgsForCall, struct {
numOfParallelWorkers int
}{numOfParallelWorkers})
fake.recordInvocation("SyncBlobs", []interface{}{numOfParallelWorkers})
fake.syncBlobsMutex.Unlock()
if fake.SyncBlobsStub != nil {
return fake.SyncBlobsStub(numOfParallelWorkers)
} else {
return fake.syncBlobsReturns.result1
}
}
func (fake *FakeBlobsDir) SyncBlobsCallCount() int {
fake.syncBlobsMutex.RLock()
defer fake.syncBlobsMutex.RUnlock()
return len(fake.syncBlobsArgsForCall)
}
func (fake *FakeBlobsDir) SyncBlobsArgsForCall(i int) int {
fake.syncBlobsMutex.RLock()
defer fake.syncBlobsMutex.RUnlock()
return fake.syncBlobsArgsForCall[i].numOfParallelWorkers
}
func (fake *FakeBlobsDir) SyncBlobsReturns(result1 error) {
fake.SyncBlobsStub = nil
fake.syncBlobsReturns = struct {
result1 error
}{result1}
}
func (fake *FakeBlobsDir) UploadBlobs() error {
fake.uploadBlobsMutex.Lock()
fake.uploadBlobsArgsForCall = append(fake.uploadBlobsArgsForCall, struct{}{})
fake.recordInvocation("UploadBlobs", []interface{}{})
fake.uploadBlobsMutex.Unlock()
if fake.UploadBlobsStub != nil {
return fake.UploadBlobsStub()
} else {
return fake.uploadBlobsReturns.result1
}
}
func (fake *FakeBlobsDir) UploadBlobsCallCount() int {
fake.uploadBlobsMutex.RLock()
defer fake.uploadBlobsMutex.RUnlock()
return len(fake.uploadBlobsArgsForCall)
}
func (fake *FakeBlobsDir) UploadBlobsReturns(result1 error) {
fake.UploadBlobsStub = nil
fake.uploadBlobsReturns = struct {
result1 error
}{result1}
}
func (fake *FakeBlobsDir) TrackBlob(arg1 string, arg2 io.ReadCloser) (releasedir.Blob, error) {
fake.trackBlobMutex.Lock()
fake.trackBlobArgsForCall = append(fake.trackBlobArgsForCall, struct {
arg1 string
arg2 io.ReadCloser
}{arg1, arg2})
fake.recordInvocation("TrackBlob", []interface{}{arg1, arg2})
fake.trackBlobMutex.Unlock()
if fake.TrackBlobStub != nil {
return fake.TrackBlobStub(arg1, arg2)
} else {
return fake.trackBlobReturns.result1, fake.trackBlobReturns.result2
}
}
func (fake *FakeBlobsDir) TrackBlobCallCount() int {
fake.trackBlobMutex.RLock()
defer fake.trackBlobMutex.RUnlock()
return len(fake.trackBlobArgsForCall)
}
func (fake *FakeBlobsDir) TrackBlobArgsForCall(i int) (string, io.ReadCloser) {
fake.trackBlobMutex.RLock()
defer fake.trackBlobMutex.RUnlock()
return fake.trackBlobArgsForCall[i].arg1, fake.trackBlobArgsForCall[i].arg2
}
func (fake *FakeBlobsDir) TrackBlobReturns(result1 releasedir.Blob, result2 error) {
fake.TrackBlobStub = nil
fake.trackBlobReturns = struct {
result1 releasedir.Blob
result2 error
}{result1, result2}
}
func (fake *FakeBlobsDir) UntrackBlob(arg1 string) error {
fake.untrackBlobMutex.Lock()
fake.untrackBlobArgsForCall = append(fake.untrackBlobArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("UntrackBlob", []interface{}{arg1})
fake.untrackBlobMutex.Unlock()
if fake.UntrackBlobStub != nil {
return fake.UntrackBlobStub(arg1)
} else {
return fake.untrackBlobReturns.result1
}
}
func (fake *FakeBlobsDir) UntrackBlobCallCount() int {
fake.untrackBlobMutex.RLock()
defer fake.untrackBlobMutex.RUnlock()
return len(fake.untrackBlobArgsForCall)
}
func (fake *FakeBlobsDir) UntrackBlobArgsForCall(i int) string {
fake.untrackBlobMutex.RLock()
defer fake.untrackBlobMutex.RUnlock()
return fake.untrackBlobArgsForCall[i].arg1
}
func (fake *FakeBlobsDir) UntrackBlobReturns(result1 error) {
fake.UntrackBlobStub = nil
fake.untrackBlobReturns = struct {
result1 error
}{result1}
}
func (fake *FakeBlobsDir) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.initMutex.RLock()
defer fake.initMutex.RUnlock()
fake.blobsMutex.RLock()
defer fake.blobsMutex.RUnlock()
fake.syncBlobsMutex.RLock()
defer fake.syncBlobsMutex.RUnlock()
fake.uploadBlobsMutex.RLock()
defer fake.uploadBlobsMutex.RUnlock()
fake.trackBlobMutex.RLock()
defer fake.trackBlobMutex.RUnlock()
fake.untrackBlobMutex.RLock()
defer fake.untrackBlobMutex.RUnlock()
return fake.invocations
}
func (fake *FakeBlobsDir) 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 _ releasedir.BlobsDir = new(FakeBlobsDir)