forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_zipper.go
176 lines (156 loc) · 4.25 KB
/
fake_zipper.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
// This file was generated by counterfeiter
package fakes
import (
. "github.com/cloudfoundry/cli/cf/app_files"
"os"
"sync"
)
type FakeZipper struct {
ZipStub func(dirToZip string, targetFile *os.File) (err error)
zipMutex sync.RWMutex
zipArgsForCall []struct {
dirToZip string
targetFile *os.File
}
zipReturns struct {
result1 error
}
IsZipFileStub func(path string) bool
isZipFileMutex sync.RWMutex
isZipFileArgsForCall []struct {
path string
}
isZipFileReturns struct {
result1 bool
}
UnzipStub func(appDir string, destDir string) (err error)
unzipMutex sync.RWMutex
unzipArgsForCall []struct {
appDir string
destDir string
}
unzipReturns struct {
result1 error
}
GetZipSizeStub func(zipFile *os.File) (int64, error)
getZipSizeMutex sync.RWMutex
getZipSizeArgsForCall []struct {
zipFile *os.File
}
getZipSizeReturns struct {
result1 int64
result2 error
}
}
func (fake *FakeZipper) Zip(dirToZip string, targetFile *os.File) (err error) {
fake.zipMutex.Lock()
defer fake.zipMutex.Unlock()
fake.zipArgsForCall = append(fake.zipArgsForCall, struct {
dirToZip string
targetFile *os.File
}{dirToZip, targetFile})
if fake.ZipStub != nil {
return fake.ZipStub(dirToZip, targetFile)
} else {
return fake.zipReturns.result1
}
}
func (fake *FakeZipper) ZipCallCount() int {
fake.zipMutex.RLock()
defer fake.zipMutex.RUnlock()
return len(fake.zipArgsForCall)
}
func (fake *FakeZipper) ZipArgsForCall(i int) (string, *os.File) {
fake.zipMutex.RLock()
defer fake.zipMutex.RUnlock()
return fake.zipArgsForCall[i].dirToZip, fake.zipArgsForCall[i].targetFile
}
func (fake *FakeZipper) ZipReturns(result1 error) {
fake.zipReturns = struct {
result1 error
}{result1}
}
func (fake *FakeZipper) IsZipFile(path string) bool {
fake.isZipFileMutex.Lock()
defer fake.isZipFileMutex.Unlock()
fake.isZipFileArgsForCall = append(fake.isZipFileArgsForCall, struct {
path string
}{path})
if fake.IsZipFileStub != nil {
return fake.IsZipFileStub(path)
} else {
return fake.isZipFileReturns.result1
}
}
func (fake *FakeZipper) IsZipFileCallCount() int {
fake.isZipFileMutex.RLock()
defer fake.isZipFileMutex.RUnlock()
return len(fake.isZipFileArgsForCall)
}
func (fake *FakeZipper) IsZipFileArgsForCall(i int) string {
fake.isZipFileMutex.RLock()
defer fake.isZipFileMutex.RUnlock()
return fake.isZipFileArgsForCall[i].path
}
func (fake *FakeZipper) IsZipFileReturns(result1 bool) {
fake.isZipFileReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeZipper) Unzip(appDir string, destDir string) (err error) {
fake.unzipMutex.Lock()
defer fake.unzipMutex.Unlock()
fake.unzipArgsForCall = append(fake.unzipArgsForCall, struct {
appDir string
destDir string
}{appDir, destDir})
if fake.UnzipStub != nil {
return fake.UnzipStub(appDir, destDir)
} else {
return fake.unzipReturns.result1
}
}
func (fake *FakeZipper) UnzipCallCount() int {
fake.unzipMutex.RLock()
defer fake.unzipMutex.RUnlock()
return len(fake.unzipArgsForCall)
}
func (fake *FakeZipper) UnzipArgsForCall(i int) (string, string) {
fake.unzipMutex.RLock()
defer fake.unzipMutex.RUnlock()
return fake.unzipArgsForCall[i].appDir, fake.unzipArgsForCall[i].destDir
}
func (fake *FakeZipper) UnzipReturns(result1 error) {
fake.unzipReturns = struct {
result1 error
}{result1}
}
func (fake *FakeZipper) GetZipSize(zipFile *os.File) (int64, error) {
fake.getZipSizeMutex.Lock()
defer fake.getZipSizeMutex.Unlock()
fake.getZipSizeArgsForCall = append(fake.getZipSizeArgsForCall, struct {
zipFile *os.File
}{zipFile})
if fake.GetZipSizeStub != nil {
return fake.GetZipSizeStub(zipFile)
} else {
return fake.getZipSizeReturns.result1, fake.getZipSizeReturns.result2
}
}
func (fake *FakeZipper) GetZipSizeCallCount() int {
fake.getZipSizeMutex.RLock()
defer fake.getZipSizeMutex.RUnlock()
return len(fake.getZipSizeArgsForCall)
}
func (fake *FakeZipper) GetZipSizeArgsForCall(i int) *os.File {
fake.getZipSizeMutex.RLock()
defer fake.getZipSizeMutex.RUnlock()
return fake.getZipSizeArgsForCall[i].zipFile
}
func (fake *FakeZipper) GetZipSizeReturns(result1 int64, result2 error) {
fake.getZipSizeReturns = struct {
result1 int64
result2 error
}{result1, result2}
}
var _ Zipper = new(FakeZipper)