github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/cf/util/utilfakes/fake_sha1checksum.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package utilfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/util" 8 ) 9 10 type FakeSha1Checksum struct { 11 ComputeFileSha1Stub func() ([]byte, error) 12 computeFileSha1Mutex sync.RWMutex 13 computeFileSha1ArgsForCall []struct{} 14 computeFileSha1Returns struct { 15 result1 []byte 16 result2 error 17 } 18 computeFileSha1ReturnsOnCall map[int]struct { 19 result1 []byte 20 result2 error 21 } 22 CheckSha1Stub func(string) bool 23 checkSha1Mutex sync.RWMutex 24 checkSha1ArgsForCall []struct { 25 arg1 string 26 } 27 checkSha1Returns struct { 28 result1 bool 29 } 30 checkSha1ReturnsOnCall map[int]struct { 31 result1 bool 32 } 33 SetFilePathStub func(string) 34 setFilePathMutex sync.RWMutex 35 setFilePathArgsForCall []struct { 36 arg1 string 37 } 38 invocations map[string][][]interface{} 39 invocationsMutex sync.RWMutex 40 } 41 42 func (fake *FakeSha1Checksum) ComputeFileSha1() ([]byte, error) { 43 fake.computeFileSha1Mutex.Lock() 44 ret, specificReturn := fake.computeFileSha1ReturnsOnCall[len(fake.computeFileSha1ArgsForCall)] 45 fake.computeFileSha1ArgsForCall = append(fake.computeFileSha1ArgsForCall, struct{}{}) 46 fake.recordInvocation("ComputeFileSha1", []interface{}{}) 47 fake.computeFileSha1Mutex.Unlock() 48 if fake.ComputeFileSha1Stub != nil { 49 return fake.ComputeFileSha1Stub() 50 } 51 if specificReturn { 52 return ret.result1, ret.result2 53 } 54 return fake.computeFileSha1Returns.result1, fake.computeFileSha1Returns.result2 55 } 56 57 func (fake *FakeSha1Checksum) ComputeFileSha1CallCount() int { 58 fake.computeFileSha1Mutex.RLock() 59 defer fake.computeFileSha1Mutex.RUnlock() 60 return len(fake.computeFileSha1ArgsForCall) 61 } 62 63 func (fake *FakeSha1Checksum) ComputeFileSha1Returns(result1 []byte, result2 error) { 64 fake.ComputeFileSha1Stub = nil 65 fake.computeFileSha1Returns = struct { 66 result1 []byte 67 result2 error 68 }{result1, result2} 69 } 70 71 func (fake *FakeSha1Checksum) ComputeFileSha1ReturnsOnCall(i int, result1 []byte, result2 error) { 72 fake.ComputeFileSha1Stub = nil 73 if fake.computeFileSha1ReturnsOnCall == nil { 74 fake.computeFileSha1ReturnsOnCall = make(map[int]struct { 75 result1 []byte 76 result2 error 77 }) 78 } 79 fake.computeFileSha1ReturnsOnCall[i] = struct { 80 result1 []byte 81 result2 error 82 }{result1, result2} 83 } 84 85 func (fake *FakeSha1Checksum) CheckSha1(arg1 string) bool { 86 fake.checkSha1Mutex.Lock() 87 ret, specificReturn := fake.checkSha1ReturnsOnCall[len(fake.checkSha1ArgsForCall)] 88 fake.checkSha1ArgsForCall = append(fake.checkSha1ArgsForCall, struct { 89 arg1 string 90 }{arg1}) 91 fake.recordInvocation("CheckSha1", []interface{}{arg1}) 92 fake.checkSha1Mutex.Unlock() 93 if fake.CheckSha1Stub != nil { 94 return fake.CheckSha1Stub(arg1) 95 } 96 if specificReturn { 97 return ret.result1 98 } 99 return fake.checkSha1Returns.result1 100 } 101 102 func (fake *FakeSha1Checksum) CheckSha1CallCount() int { 103 fake.checkSha1Mutex.RLock() 104 defer fake.checkSha1Mutex.RUnlock() 105 return len(fake.checkSha1ArgsForCall) 106 } 107 108 func (fake *FakeSha1Checksum) CheckSha1ArgsForCall(i int) string { 109 fake.checkSha1Mutex.RLock() 110 defer fake.checkSha1Mutex.RUnlock() 111 return fake.checkSha1ArgsForCall[i].arg1 112 } 113 114 func (fake *FakeSha1Checksum) CheckSha1Returns(result1 bool) { 115 fake.CheckSha1Stub = nil 116 fake.checkSha1Returns = struct { 117 result1 bool 118 }{result1} 119 } 120 121 func (fake *FakeSha1Checksum) CheckSha1ReturnsOnCall(i int, result1 bool) { 122 fake.CheckSha1Stub = nil 123 if fake.checkSha1ReturnsOnCall == nil { 124 fake.checkSha1ReturnsOnCall = make(map[int]struct { 125 result1 bool 126 }) 127 } 128 fake.checkSha1ReturnsOnCall[i] = struct { 129 result1 bool 130 }{result1} 131 } 132 133 func (fake *FakeSha1Checksum) SetFilePath(arg1 string) { 134 fake.setFilePathMutex.Lock() 135 fake.setFilePathArgsForCall = append(fake.setFilePathArgsForCall, struct { 136 arg1 string 137 }{arg1}) 138 fake.recordInvocation("SetFilePath", []interface{}{arg1}) 139 fake.setFilePathMutex.Unlock() 140 if fake.SetFilePathStub != nil { 141 fake.SetFilePathStub(arg1) 142 } 143 } 144 145 func (fake *FakeSha1Checksum) SetFilePathCallCount() int { 146 fake.setFilePathMutex.RLock() 147 defer fake.setFilePathMutex.RUnlock() 148 return len(fake.setFilePathArgsForCall) 149 } 150 151 func (fake *FakeSha1Checksum) SetFilePathArgsForCall(i int) string { 152 fake.setFilePathMutex.RLock() 153 defer fake.setFilePathMutex.RUnlock() 154 return fake.setFilePathArgsForCall[i].arg1 155 } 156 157 func (fake *FakeSha1Checksum) Invocations() map[string][][]interface{} { 158 fake.invocationsMutex.RLock() 159 defer fake.invocationsMutex.RUnlock() 160 fake.computeFileSha1Mutex.RLock() 161 defer fake.computeFileSha1Mutex.RUnlock() 162 fake.checkSha1Mutex.RLock() 163 defer fake.checkSha1Mutex.RUnlock() 164 fake.setFilePathMutex.RLock() 165 defer fake.setFilePathMutex.RUnlock() 166 copiedInvocations := map[string][][]interface{}{} 167 for key, value := range fake.invocations { 168 copiedInvocations[key] = value 169 } 170 return copiedInvocations 171 } 172 173 func (fake *FakeSha1Checksum) recordInvocation(key string, args []interface{}) { 174 fake.invocationsMutex.Lock() 175 defer fake.invocationsMutex.Unlock() 176 if fake.invocations == nil { 177 fake.invocations = map[string][][]interface{}{} 178 } 179 if fake.invocations[key] == nil { 180 fake.invocations[key] = [][]interface{}{} 181 } 182 fake.invocations[key] = append(fake.invocations[key], args) 183 } 184 185 var _ util.Sha1Checksum = new(FakeSha1Checksum)