github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/util/download/downloadfakes/fake_progress_bar.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package downloadfakes 3 4 import ( 5 "io" 6 "sync" 7 8 "code.cloudfoundry.org/cli/util/download" 9 pb "gopkg.in/cheggaaa/pb.v1" 10 ) 11 12 type FakeProgressBar struct { 13 FinishStub func() 14 finishMutex sync.RWMutex 15 finishArgsForCall []struct { 16 } 17 NewProxyReaderStub func(io.Reader) *pb.Reader 18 newProxyReaderMutex sync.RWMutex 19 newProxyReaderArgsForCall []struct { 20 arg1 io.Reader 21 } 22 newProxyReaderReturns struct { 23 result1 *pb.Reader 24 } 25 newProxyReaderReturnsOnCall map[int]struct { 26 result1 *pb.Reader 27 } 28 SetTotalStub func(int) *pb.ProgressBar 29 setTotalMutex sync.RWMutex 30 setTotalArgsForCall []struct { 31 arg1 int 32 } 33 setTotalReturns struct { 34 result1 *pb.ProgressBar 35 } 36 setTotalReturnsOnCall map[int]struct { 37 result1 *pb.ProgressBar 38 } 39 StartStub func() *pb.ProgressBar 40 startMutex sync.RWMutex 41 startArgsForCall []struct { 42 } 43 startReturns struct { 44 result1 *pb.ProgressBar 45 } 46 startReturnsOnCall map[int]struct { 47 result1 *pb.ProgressBar 48 } 49 invocations map[string][][]interface{} 50 invocationsMutex sync.RWMutex 51 } 52 53 func (fake *FakeProgressBar) Finish() { 54 fake.finishMutex.Lock() 55 fake.finishArgsForCall = append(fake.finishArgsForCall, struct { 56 }{}) 57 fake.recordInvocation("Finish", []interface{}{}) 58 fake.finishMutex.Unlock() 59 if fake.FinishStub != nil { 60 fake.FinishStub() 61 } 62 } 63 64 func (fake *FakeProgressBar) FinishCallCount() int { 65 fake.finishMutex.RLock() 66 defer fake.finishMutex.RUnlock() 67 return len(fake.finishArgsForCall) 68 } 69 70 func (fake *FakeProgressBar) FinishCalls(stub func()) { 71 fake.finishMutex.Lock() 72 defer fake.finishMutex.Unlock() 73 fake.FinishStub = stub 74 } 75 76 func (fake *FakeProgressBar) NewProxyReader(arg1 io.Reader) *pb.Reader { 77 fake.newProxyReaderMutex.Lock() 78 ret, specificReturn := fake.newProxyReaderReturnsOnCall[len(fake.newProxyReaderArgsForCall)] 79 fake.newProxyReaderArgsForCall = append(fake.newProxyReaderArgsForCall, struct { 80 arg1 io.Reader 81 }{arg1}) 82 fake.recordInvocation("NewProxyReader", []interface{}{arg1}) 83 fake.newProxyReaderMutex.Unlock() 84 if fake.NewProxyReaderStub != nil { 85 return fake.NewProxyReaderStub(arg1) 86 } 87 if specificReturn { 88 return ret.result1 89 } 90 fakeReturns := fake.newProxyReaderReturns 91 return fakeReturns.result1 92 } 93 94 func (fake *FakeProgressBar) NewProxyReaderCallCount() int { 95 fake.newProxyReaderMutex.RLock() 96 defer fake.newProxyReaderMutex.RUnlock() 97 return len(fake.newProxyReaderArgsForCall) 98 } 99 100 func (fake *FakeProgressBar) NewProxyReaderCalls(stub func(io.Reader) *pb.Reader) { 101 fake.newProxyReaderMutex.Lock() 102 defer fake.newProxyReaderMutex.Unlock() 103 fake.NewProxyReaderStub = stub 104 } 105 106 func (fake *FakeProgressBar) NewProxyReaderArgsForCall(i int) io.Reader { 107 fake.newProxyReaderMutex.RLock() 108 defer fake.newProxyReaderMutex.RUnlock() 109 argsForCall := fake.newProxyReaderArgsForCall[i] 110 return argsForCall.arg1 111 } 112 113 func (fake *FakeProgressBar) NewProxyReaderReturns(result1 *pb.Reader) { 114 fake.newProxyReaderMutex.Lock() 115 defer fake.newProxyReaderMutex.Unlock() 116 fake.NewProxyReaderStub = nil 117 fake.newProxyReaderReturns = struct { 118 result1 *pb.Reader 119 }{result1} 120 } 121 122 func (fake *FakeProgressBar) NewProxyReaderReturnsOnCall(i int, result1 *pb.Reader) { 123 fake.newProxyReaderMutex.Lock() 124 defer fake.newProxyReaderMutex.Unlock() 125 fake.NewProxyReaderStub = nil 126 if fake.newProxyReaderReturnsOnCall == nil { 127 fake.newProxyReaderReturnsOnCall = make(map[int]struct { 128 result1 *pb.Reader 129 }) 130 } 131 fake.newProxyReaderReturnsOnCall[i] = struct { 132 result1 *pb.Reader 133 }{result1} 134 } 135 136 func (fake *FakeProgressBar) SetTotal(arg1 int) *pb.ProgressBar { 137 fake.setTotalMutex.Lock() 138 ret, specificReturn := fake.setTotalReturnsOnCall[len(fake.setTotalArgsForCall)] 139 fake.setTotalArgsForCall = append(fake.setTotalArgsForCall, struct { 140 arg1 int 141 }{arg1}) 142 fake.recordInvocation("SetTotal", []interface{}{arg1}) 143 fake.setTotalMutex.Unlock() 144 if fake.SetTotalStub != nil { 145 return fake.SetTotalStub(arg1) 146 } 147 if specificReturn { 148 return ret.result1 149 } 150 fakeReturns := fake.setTotalReturns 151 return fakeReturns.result1 152 } 153 154 func (fake *FakeProgressBar) SetTotalCallCount() int { 155 fake.setTotalMutex.RLock() 156 defer fake.setTotalMutex.RUnlock() 157 return len(fake.setTotalArgsForCall) 158 } 159 160 func (fake *FakeProgressBar) SetTotalCalls(stub func(int) *pb.ProgressBar) { 161 fake.setTotalMutex.Lock() 162 defer fake.setTotalMutex.Unlock() 163 fake.SetTotalStub = stub 164 } 165 166 func (fake *FakeProgressBar) SetTotalArgsForCall(i int) int { 167 fake.setTotalMutex.RLock() 168 defer fake.setTotalMutex.RUnlock() 169 argsForCall := fake.setTotalArgsForCall[i] 170 return argsForCall.arg1 171 } 172 173 func (fake *FakeProgressBar) SetTotalReturns(result1 *pb.ProgressBar) { 174 fake.setTotalMutex.Lock() 175 defer fake.setTotalMutex.Unlock() 176 fake.SetTotalStub = nil 177 fake.setTotalReturns = struct { 178 result1 *pb.ProgressBar 179 }{result1} 180 } 181 182 func (fake *FakeProgressBar) SetTotalReturnsOnCall(i int, result1 *pb.ProgressBar) { 183 fake.setTotalMutex.Lock() 184 defer fake.setTotalMutex.Unlock() 185 fake.SetTotalStub = nil 186 if fake.setTotalReturnsOnCall == nil { 187 fake.setTotalReturnsOnCall = make(map[int]struct { 188 result1 *pb.ProgressBar 189 }) 190 } 191 fake.setTotalReturnsOnCall[i] = struct { 192 result1 *pb.ProgressBar 193 }{result1} 194 } 195 196 func (fake *FakeProgressBar) Start() *pb.ProgressBar { 197 fake.startMutex.Lock() 198 ret, specificReturn := fake.startReturnsOnCall[len(fake.startArgsForCall)] 199 fake.startArgsForCall = append(fake.startArgsForCall, struct { 200 }{}) 201 fake.recordInvocation("Start", []interface{}{}) 202 fake.startMutex.Unlock() 203 if fake.StartStub != nil { 204 return fake.StartStub() 205 } 206 if specificReturn { 207 return ret.result1 208 } 209 fakeReturns := fake.startReturns 210 return fakeReturns.result1 211 } 212 213 func (fake *FakeProgressBar) StartCallCount() int { 214 fake.startMutex.RLock() 215 defer fake.startMutex.RUnlock() 216 return len(fake.startArgsForCall) 217 } 218 219 func (fake *FakeProgressBar) StartCalls(stub func() *pb.ProgressBar) { 220 fake.startMutex.Lock() 221 defer fake.startMutex.Unlock() 222 fake.StartStub = stub 223 } 224 225 func (fake *FakeProgressBar) StartReturns(result1 *pb.ProgressBar) { 226 fake.startMutex.Lock() 227 defer fake.startMutex.Unlock() 228 fake.StartStub = nil 229 fake.startReturns = struct { 230 result1 *pb.ProgressBar 231 }{result1} 232 } 233 234 func (fake *FakeProgressBar) StartReturnsOnCall(i int, result1 *pb.ProgressBar) { 235 fake.startMutex.Lock() 236 defer fake.startMutex.Unlock() 237 fake.StartStub = nil 238 if fake.startReturnsOnCall == nil { 239 fake.startReturnsOnCall = make(map[int]struct { 240 result1 *pb.ProgressBar 241 }) 242 } 243 fake.startReturnsOnCall[i] = struct { 244 result1 *pb.ProgressBar 245 }{result1} 246 } 247 248 func (fake *FakeProgressBar) Invocations() map[string][][]interface{} { 249 fake.invocationsMutex.RLock() 250 defer fake.invocationsMutex.RUnlock() 251 fake.finishMutex.RLock() 252 defer fake.finishMutex.RUnlock() 253 fake.newProxyReaderMutex.RLock() 254 defer fake.newProxyReaderMutex.RUnlock() 255 fake.setTotalMutex.RLock() 256 defer fake.setTotalMutex.RUnlock() 257 fake.startMutex.RLock() 258 defer fake.startMutex.RUnlock() 259 copiedInvocations := map[string][][]interface{}{} 260 for key, value := range fake.invocations { 261 copiedInvocations[key] = value 262 } 263 return copiedInvocations 264 } 265 266 func (fake *FakeProgressBar) recordInvocation(key string, args []interface{}) { 267 fake.invocationsMutex.Lock() 268 defer fake.invocationsMutex.Unlock() 269 if fake.invocations == nil { 270 fake.invocations = map[string][][]interface{}{} 271 } 272 if fake.invocations[key] == nil { 273 fake.invocations[key] = [][]interface{}{} 274 } 275 fake.invocations[key] = append(fake.invocations[key], args) 276 } 277 278 var _ download.ProgressBar = new(FakeProgressBar)