github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/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  	CheckSha1Stub        func(string) bool
    12  	checkSha1Mutex       sync.RWMutex
    13  	checkSha1ArgsForCall []struct {
    14  		arg1 string
    15  	}
    16  	checkSha1Returns struct {
    17  		result1 bool
    18  	}
    19  	checkSha1ReturnsOnCall map[int]struct {
    20  		result1 bool
    21  	}
    22  	ComputeFileSha1Stub        func() ([]byte, error)
    23  	computeFileSha1Mutex       sync.RWMutex
    24  	computeFileSha1ArgsForCall []struct {
    25  	}
    26  	computeFileSha1Returns struct {
    27  		result1 []byte
    28  		result2 error
    29  	}
    30  	computeFileSha1ReturnsOnCall map[int]struct {
    31  		result1 []byte
    32  		result2 error
    33  	}
    34  	SetFilePathStub        func(string)
    35  	setFilePathMutex       sync.RWMutex
    36  	setFilePathArgsForCall []struct {
    37  		arg1 string
    38  	}
    39  	invocations      map[string][][]interface{}
    40  	invocationsMutex sync.RWMutex
    41  }
    42  
    43  func (fake *FakeSha1Checksum) CheckSha1(arg1 string) bool {
    44  	fake.checkSha1Mutex.Lock()
    45  	ret, specificReturn := fake.checkSha1ReturnsOnCall[len(fake.checkSha1ArgsForCall)]
    46  	fake.checkSha1ArgsForCall = append(fake.checkSha1ArgsForCall, struct {
    47  		arg1 string
    48  	}{arg1})
    49  	fake.recordInvocation("CheckSha1", []interface{}{arg1})
    50  	fake.checkSha1Mutex.Unlock()
    51  	if fake.CheckSha1Stub != nil {
    52  		return fake.CheckSha1Stub(arg1)
    53  	}
    54  	if specificReturn {
    55  		return ret.result1
    56  	}
    57  	fakeReturns := fake.checkSha1Returns
    58  	return fakeReturns.result1
    59  }
    60  
    61  func (fake *FakeSha1Checksum) CheckSha1CallCount() int {
    62  	fake.checkSha1Mutex.RLock()
    63  	defer fake.checkSha1Mutex.RUnlock()
    64  	return len(fake.checkSha1ArgsForCall)
    65  }
    66  
    67  func (fake *FakeSha1Checksum) CheckSha1Calls(stub func(string) bool) {
    68  	fake.checkSha1Mutex.Lock()
    69  	defer fake.checkSha1Mutex.Unlock()
    70  	fake.CheckSha1Stub = stub
    71  }
    72  
    73  func (fake *FakeSha1Checksum) CheckSha1ArgsForCall(i int) string {
    74  	fake.checkSha1Mutex.RLock()
    75  	defer fake.checkSha1Mutex.RUnlock()
    76  	argsForCall := fake.checkSha1ArgsForCall[i]
    77  	return argsForCall.arg1
    78  }
    79  
    80  func (fake *FakeSha1Checksum) CheckSha1Returns(result1 bool) {
    81  	fake.checkSha1Mutex.Lock()
    82  	defer fake.checkSha1Mutex.Unlock()
    83  	fake.CheckSha1Stub = nil
    84  	fake.checkSha1Returns = struct {
    85  		result1 bool
    86  	}{result1}
    87  }
    88  
    89  func (fake *FakeSha1Checksum) CheckSha1ReturnsOnCall(i int, result1 bool) {
    90  	fake.checkSha1Mutex.Lock()
    91  	defer fake.checkSha1Mutex.Unlock()
    92  	fake.CheckSha1Stub = nil
    93  	if fake.checkSha1ReturnsOnCall == nil {
    94  		fake.checkSha1ReturnsOnCall = make(map[int]struct {
    95  			result1 bool
    96  		})
    97  	}
    98  	fake.checkSha1ReturnsOnCall[i] = struct {
    99  		result1 bool
   100  	}{result1}
   101  }
   102  
   103  func (fake *FakeSha1Checksum) ComputeFileSha1() ([]byte, error) {
   104  	fake.computeFileSha1Mutex.Lock()
   105  	ret, specificReturn := fake.computeFileSha1ReturnsOnCall[len(fake.computeFileSha1ArgsForCall)]
   106  	fake.computeFileSha1ArgsForCall = append(fake.computeFileSha1ArgsForCall, struct {
   107  	}{})
   108  	fake.recordInvocation("ComputeFileSha1", []interface{}{})
   109  	fake.computeFileSha1Mutex.Unlock()
   110  	if fake.ComputeFileSha1Stub != nil {
   111  		return fake.ComputeFileSha1Stub()
   112  	}
   113  	if specificReturn {
   114  		return ret.result1, ret.result2
   115  	}
   116  	fakeReturns := fake.computeFileSha1Returns
   117  	return fakeReturns.result1, fakeReturns.result2
   118  }
   119  
   120  func (fake *FakeSha1Checksum) ComputeFileSha1CallCount() int {
   121  	fake.computeFileSha1Mutex.RLock()
   122  	defer fake.computeFileSha1Mutex.RUnlock()
   123  	return len(fake.computeFileSha1ArgsForCall)
   124  }
   125  
   126  func (fake *FakeSha1Checksum) ComputeFileSha1Calls(stub func() ([]byte, error)) {
   127  	fake.computeFileSha1Mutex.Lock()
   128  	defer fake.computeFileSha1Mutex.Unlock()
   129  	fake.ComputeFileSha1Stub = stub
   130  }
   131  
   132  func (fake *FakeSha1Checksum) ComputeFileSha1Returns(result1 []byte, result2 error) {
   133  	fake.computeFileSha1Mutex.Lock()
   134  	defer fake.computeFileSha1Mutex.Unlock()
   135  	fake.ComputeFileSha1Stub = nil
   136  	fake.computeFileSha1Returns = struct {
   137  		result1 []byte
   138  		result2 error
   139  	}{result1, result2}
   140  }
   141  
   142  func (fake *FakeSha1Checksum) ComputeFileSha1ReturnsOnCall(i int, result1 []byte, result2 error) {
   143  	fake.computeFileSha1Mutex.Lock()
   144  	defer fake.computeFileSha1Mutex.Unlock()
   145  	fake.ComputeFileSha1Stub = nil
   146  	if fake.computeFileSha1ReturnsOnCall == nil {
   147  		fake.computeFileSha1ReturnsOnCall = make(map[int]struct {
   148  			result1 []byte
   149  			result2 error
   150  		})
   151  	}
   152  	fake.computeFileSha1ReturnsOnCall[i] = struct {
   153  		result1 []byte
   154  		result2 error
   155  	}{result1, result2}
   156  }
   157  
   158  func (fake *FakeSha1Checksum) SetFilePath(arg1 string) {
   159  	fake.setFilePathMutex.Lock()
   160  	fake.setFilePathArgsForCall = append(fake.setFilePathArgsForCall, struct {
   161  		arg1 string
   162  	}{arg1})
   163  	fake.recordInvocation("SetFilePath", []interface{}{arg1})
   164  	fake.setFilePathMutex.Unlock()
   165  	if fake.SetFilePathStub != nil {
   166  		fake.SetFilePathStub(arg1)
   167  	}
   168  }
   169  
   170  func (fake *FakeSha1Checksum) SetFilePathCallCount() int {
   171  	fake.setFilePathMutex.RLock()
   172  	defer fake.setFilePathMutex.RUnlock()
   173  	return len(fake.setFilePathArgsForCall)
   174  }
   175  
   176  func (fake *FakeSha1Checksum) SetFilePathCalls(stub func(string)) {
   177  	fake.setFilePathMutex.Lock()
   178  	defer fake.setFilePathMutex.Unlock()
   179  	fake.SetFilePathStub = stub
   180  }
   181  
   182  func (fake *FakeSha1Checksum) SetFilePathArgsForCall(i int) string {
   183  	fake.setFilePathMutex.RLock()
   184  	defer fake.setFilePathMutex.RUnlock()
   185  	argsForCall := fake.setFilePathArgsForCall[i]
   186  	return argsForCall.arg1
   187  }
   188  
   189  func (fake *FakeSha1Checksum) Invocations() map[string][][]interface{} {
   190  	fake.invocationsMutex.RLock()
   191  	defer fake.invocationsMutex.RUnlock()
   192  	fake.checkSha1Mutex.RLock()
   193  	defer fake.checkSha1Mutex.RUnlock()
   194  	fake.computeFileSha1Mutex.RLock()
   195  	defer fake.computeFileSha1Mutex.RUnlock()
   196  	fake.setFilePathMutex.RLock()
   197  	defer fake.setFilePathMutex.RUnlock()
   198  	copiedInvocations := map[string][][]interface{}{}
   199  	for key, value := range fake.invocations {
   200  		copiedInvocations[key] = value
   201  	}
   202  	return copiedInvocations
   203  }
   204  
   205  func (fake *FakeSha1Checksum) recordInvocation(key string, args []interface{}) {
   206  	fake.invocationsMutex.Lock()
   207  	defer fake.invocationsMutex.Unlock()
   208  	if fake.invocations == nil {
   209  		fake.invocations = map[string][][]interface{}{}
   210  	}
   211  	if fake.invocations[key] == nil {
   212  		fake.invocations[key] = [][]interface{}{}
   213  	}
   214  	fake.invocations[key] = append(fake.invocations[key], args)
   215  }
   216  
   217  var _ util.Sha1Checksum = new(FakeSha1Checksum)