github.com/asifdxtreme/cli@v6.1.3-0.20150123051144-9ead8700b4ae+incompatible/cf/app_files/fakes/fake_zipper.go (about)

     1  // This file was generated by counterfeiter
     2  package fakes
     3  
     4  import (
     5  	. "github.com/cloudfoundry/cli/cf/app_files"
     6  
     7  	"os"
     8  	"sync"
     9  )
    10  
    11  type FakeZipper struct {
    12  	ZipStub        func(dirToZip string, targetFile *os.File) (err error)
    13  	zipMutex       sync.RWMutex
    14  	zipArgsForCall []struct {
    15  		dirToZip   string
    16  		targetFile *os.File
    17  	}
    18  	zipReturns struct {
    19  		result1 error
    20  	}
    21  	IsZipFileStub        func(path string) bool
    22  	isZipFileMutex       sync.RWMutex
    23  	isZipFileArgsForCall []struct {
    24  		path string
    25  	}
    26  	isZipFileReturns struct {
    27  		result1 bool
    28  	}
    29  	UnzipStub        func(appDir string, destDir string) (err error)
    30  	unzipMutex       sync.RWMutex
    31  	unzipArgsForCall []struct {
    32  		appDir  string
    33  		destDir string
    34  	}
    35  	unzipReturns struct {
    36  		result1 error
    37  	}
    38  	GetZipSizeStub        func(zipFile *os.File) (int64, error)
    39  	getZipSizeMutex       sync.RWMutex
    40  	getZipSizeArgsForCall []struct {
    41  		zipFile *os.File
    42  	}
    43  	getZipSizeReturns struct {
    44  		result1 int64
    45  		result2 error
    46  	}
    47  }
    48  
    49  func (fake *FakeZipper) Zip(dirToZip string, targetFile *os.File) (err error) {
    50  	fake.zipMutex.Lock()
    51  	defer fake.zipMutex.Unlock()
    52  	fake.zipArgsForCall = append(fake.zipArgsForCall, struct {
    53  		dirToZip   string
    54  		targetFile *os.File
    55  	}{dirToZip, targetFile})
    56  	if fake.ZipStub != nil {
    57  		return fake.ZipStub(dirToZip, targetFile)
    58  	} else {
    59  		return fake.zipReturns.result1
    60  	}
    61  }
    62  
    63  func (fake *FakeZipper) ZipCallCount() int {
    64  	fake.zipMutex.RLock()
    65  	defer fake.zipMutex.RUnlock()
    66  	return len(fake.zipArgsForCall)
    67  }
    68  
    69  func (fake *FakeZipper) ZipArgsForCall(i int) (string, *os.File) {
    70  	fake.zipMutex.RLock()
    71  	defer fake.zipMutex.RUnlock()
    72  	return fake.zipArgsForCall[i].dirToZip, fake.zipArgsForCall[i].targetFile
    73  }
    74  
    75  func (fake *FakeZipper) ZipReturns(result1 error) {
    76  	fake.zipReturns = struct {
    77  		result1 error
    78  	}{result1}
    79  }
    80  
    81  func (fake *FakeZipper) IsZipFile(path string) bool {
    82  	fake.isZipFileMutex.Lock()
    83  	defer fake.isZipFileMutex.Unlock()
    84  	fake.isZipFileArgsForCall = append(fake.isZipFileArgsForCall, struct {
    85  		path string
    86  	}{path})
    87  	if fake.IsZipFileStub != nil {
    88  		return fake.IsZipFileStub(path)
    89  	} else {
    90  		return fake.isZipFileReturns.result1
    91  	}
    92  }
    93  
    94  func (fake *FakeZipper) IsZipFileCallCount() int {
    95  	fake.isZipFileMutex.RLock()
    96  	defer fake.isZipFileMutex.RUnlock()
    97  	return len(fake.isZipFileArgsForCall)
    98  }
    99  
   100  func (fake *FakeZipper) IsZipFileArgsForCall(i int) string {
   101  	fake.isZipFileMutex.RLock()
   102  	defer fake.isZipFileMutex.RUnlock()
   103  	return fake.isZipFileArgsForCall[i].path
   104  }
   105  
   106  func (fake *FakeZipper) IsZipFileReturns(result1 bool) {
   107  	fake.isZipFileReturns = struct {
   108  		result1 bool
   109  	}{result1}
   110  }
   111  
   112  func (fake *FakeZipper) Unzip(appDir string, destDir string) (err error) {
   113  	fake.unzipMutex.Lock()
   114  	defer fake.unzipMutex.Unlock()
   115  	fake.unzipArgsForCall = append(fake.unzipArgsForCall, struct {
   116  		appDir  string
   117  		destDir string
   118  	}{appDir, destDir})
   119  	if fake.UnzipStub != nil {
   120  		return fake.UnzipStub(appDir, destDir)
   121  	} else {
   122  		return fake.unzipReturns.result1
   123  	}
   124  }
   125  
   126  func (fake *FakeZipper) UnzipCallCount() int {
   127  	fake.unzipMutex.RLock()
   128  	defer fake.unzipMutex.RUnlock()
   129  	return len(fake.unzipArgsForCall)
   130  }
   131  
   132  func (fake *FakeZipper) UnzipArgsForCall(i int) (string, string) {
   133  	fake.unzipMutex.RLock()
   134  	defer fake.unzipMutex.RUnlock()
   135  	return fake.unzipArgsForCall[i].appDir, fake.unzipArgsForCall[i].destDir
   136  }
   137  
   138  func (fake *FakeZipper) UnzipReturns(result1 error) {
   139  	fake.unzipReturns = struct {
   140  		result1 error
   141  	}{result1}
   142  }
   143  
   144  func (fake *FakeZipper) GetZipSize(zipFile *os.File) (int64, error) {
   145  	fake.getZipSizeMutex.Lock()
   146  	defer fake.getZipSizeMutex.Unlock()
   147  	fake.getZipSizeArgsForCall = append(fake.getZipSizeArgsForCall, struct {
   148  		zipFile *os.File
   149  	}{zipFile})
   150  	if fake.GetZipSizeStub != nil {
   151  		return fake.GetZipSizeStub(zipFile)
   152  	} else {
   153  		return fake.getZipSizeReturns.result1, fake.getZipSizeReturns.result2
   154  	}
   155  }
   156  
   157  func (fake *FakeZipper) GetZipSizeCallCount() int {
   158  	fake.getZipSizeMutex.RLock()
   159  	defer fake.getZipSizeMutex.RUnlock()
   160  	return len(fake.getZipSizeArgsForCall)
   161  }
   162  
   163  func (fake *FakeZipper) GetZipSizeArgsForCall(i int) *os.File {
   164  	fake.getZipSizeMutex.RLock()
   165  	defer fake.getZipSizeMutex.RUnlock()
   166  	return fake.getZipSizeArgsForCall[i].zipFile
   167  }
   168  
   169  func (fake *FakeZipper) GetZipSizeReturns(result1 int64, result2 error) {
   170  	fake.getZipSizeReturns = struct {
   171  		result1 int64
   172  		result2 error
   173  	}{result1, result2}
   174  }
   175  
   176  var _ Zipper = new(FakeZipper)