forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_sha1checksum.go
217 lines (196 loc) · 5.97 KB
/
fake_sha1checksum.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
// Code generated by counterfeiter. DO NOT EDIT.
package utilfakes
import (
"sync"
"code.cloudfoundry.org/cli/util"
)
type FakeSha1Checksum struct {
CheckSha1Stub func(string) bool
checkSha1Mutex sync.RWMutex
checkSha1ArgsForCall []struct {
arg1 string
}
checkSha1Returns struct {
result1 bool
}
checkSha1ReturnsOnCall map[int]struct {
result1 bool
}
ComputeFileSha1Stub func() ([]byte, error)
computeFileSha1Mutex sync.RWMutex
computeFileSha1ArgsForCall []struct {
}
computeFileSha1Returns struct {
result1 []byte
result2 error
}
computeFileSha1ReturnsOnCall map[int]struct {
result1 []byte
result2 error
}
SetFilePathStub func(string)
setFilePathMutex sync.RWMutex
setFilePathArgsForCall []struct {
arg1 string
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeSha1Checksum) CheckSha1(arg1 string) bool {
fake.checkSha1Mutex.Lock()
ret, specificReturn := fake.checkSha1ReturnsOnCall[len(fake.checkSha1ArgsForCall)]
fake.checkSha1ArgsForCall = append(fake.checkSha1ArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("CheckSha1", []interface{}{arg1})
fake.checkSha1Mutex.Unlock()
if fake.CheckSha1Stub != nil {
return fake.CheckSha1Stub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.checkSha1Returns
return fakeReturns.result1
}
func (fake *FakeSha1Checksum) CheckSha1CallCount() int {
fake.checkSha1Mutex.RLock()
defer fake.checkSha1Mutex.RUnlock()
return len(fake.checkSha1ArgsForCall)
}
func (fake *FakeSha1Checksum) CheckSha1Calls(stub func(string) bool) {
fake.checkSha1Mutex.Lock()
defer fake.checkSha1Mutex.Unlock()
fake.CheckSha1Stub = stub
}
func (fake *FakeSha1Checksum) CheckSha1ArgsForCall(i int) string {
fake.checkSha1Mutex.RLock()
defer fake.checkSha1Mutex.RUnlock()
argsForCall := fake.checkSha1ArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeSha1Checksum) CheckSha1Returns(result1 bool) {
fake.checkSha1Mutex.Lock()
defer fake.checkSha1Mutex.Unlock()
fake.CheckSha1Stub = nil
fake.checkSha1Returns = struct {
result1 bool
}{result1}
}
func (fake *FakeSha1Checksum) CheckSha1ReturnsOnCall(i int, result1 bool) {
fake.checkSha1Mutex.Lock()
defer fake.checkSha1Mutex.Unlock()
fake.CheckSha1Stub = nil
if fake.checkSha1ReturnsOnCall == nil {
fake.checkSha1ReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.checkSha1ReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *FakeSha1Checksum) ComputeFileSha1() ([]byte, error) {
fake.computeFileSha1Mutex.Lock()
ret, specificReturn := fake.computeFileSha1ReturnsOnCall[len(fake.computeFileSha1ArgsForCall)]
fake.computeFileSha1ArgsForCall = append(fake.computeFileSha1ArgsForCall, struct {
}{})
fake.recordInvocation("ComputeFileSha1", []interface{}{})
fake.computeFileSha1Mutex.Unlock()
if fake.ComputeFileSha1Stub != nil {
return fake.ComputeFileSha1Stub()
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.computeFileSha1Returns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *FakeSha1Checksum) ComputeFileSha1CallCount() int {
fake.computeFileSha1Mutex.RLock()
defer fake.computeFileSha1Mutex.RUnlock()
return len(fake.computeFileSha1ArgsForCall)
}
func (fake *FakeSha1Checksum) ComputeFileSha1Calls(stub func() ([]byte, error)) {
fake.computeFileSha1Mutex.Lock()
defer fake.computeFileSha1Mutex.Unlock()
fake.ComputeFileSha1Stub = stub
}
func (fake *FakeSha1Checksum) ComputeFileSha1Returns(result1 []byte, result2 error) {
fake.computeFileSha1Mutex.Lock()
defer fake.computeFileSha1Mutex.Unlock()
fake.ComputeFileSha1Stub = nil
fake.computeFileSha1Returns = struct {
result1 []byte
result2 error
}{result1, result2}
}
func (fake *FakeSha1Checksum) ComputeFileSha1ReturnsOnCall(i int, result1 []byte, result2 error) {
fake.computeFileSha1Mutex.Lock()
defer fake.computeFileSha1Mutex.Unlock()
fake.ComputeFileSha1Stub = nil
if fake.computeFileSha1ReturnsOnCall == nil {
fake.computeFileSha1ReturnsOnCall = make(map[int]struct {
result1 []byte
result2 error
})
}
fake.computeFileSha1ReturnsOnCall[i] = struct {
result1 []byte
result2 error
}{result1, result2}
}
func (fake *FakeSha1Checksum) SetFilePath(arg1 string) {
fake.setFilePathMutex.Lock()
fake.setFilePathArgsForCall = append(fake.setFilePathArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("SetFilePath", []interface{}{arg1})
fake.setFilePathMutex.Unlock()
if fake.SetFilePathStub != nil {
fake.SetFilePathStub(arg1)
}
}
func (fake *FakeSha1Checksum) SetFilePathCallCount() int {
fake.setFilePathMutex.RLock()
defer fake.setFilePathMutex.RUnlock()
return len(fake.setFilePathArgsForCall)
}
func (fake *FakeSha1Checksum) SetFilePathCalls(stub func(string)) {
fake.setFilePathMutex.Lock()
defer fake.setFilePathMutex.Unlock()
fake.SetFilePathStub = stub
}
func (fake *FakeSha1Checksum) SetFilePathArgsForCall(i int) string {
fake.setFilePathMutex.RLock()
defer fake.setFilePathMutex.RUnlock()
argsForCall := fake.setFilePathArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeSha1Checksum) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.checkSha1Mutex.RLock()
defer fake.checkSha1Mutex.RUnlock()
fake.computeFileSha1Mutex.RLock()
defer fake.computeFileSha1Mutex.RUnlock()
fake.setFilePathMutex.RLock()
defer fake.setFilePathMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeSha1Checksum) 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 _ util.Sha1Checksum = new(FakeSha1Checksum)