-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_push_actor.go
150 lines (134 loc) · 4.64 KB
/
fake_push_actor.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
// This file was generated by counterfeiter
package fakes
import (
"os"
"sync"
"github.com/cloudfoundry/cli/cf/actors"
"github.com/cloudfoundry/cli/cf/api/resources"
"github.com/cloudfoundry/cli/cf/models"
)
type FakePushActor struct {
UploadAppStub func(appGuid string, zipFile *os.File, presentFiles []resources.AppFileResource) error
uploadAppMutex sync.RWMutex
uploadAppArgsForCall []struct {
appGuid string
zipFile *os.File
presentFiles []resources.AppFileResource
}
uploadAppReturns struct {
result1 error
}
ProcessPathStub func(dirOrZipFile string, f func(string)) error
processPathMutex sync.RWMutex
processPathArgsForCall []struct {
dirOrZipFile string
f func(string)
}
processPathReturns struct {
result1 error
}
GatherFilesStub func(localFiles []models.AppFileFields, appDir string, uploadDir string) ([]resources.AppFileResource, bool, error)
gatherFilesMutex sync.RWMutex
gatherFilesArgsForCall []struct {
localFiles []models.AppFileFields
appDir string
uploadDir string
}
gatherFilesReturns struct {
result1 []resources.AppFileResource
result2 bool
result3 error
}
}
func (fake *FakePushActor) UploadApp(appGuid string, zipFile *os.File, presentFiles []resources.AppFileResource) error {
fake.uploadAppMutex.Lock()
fake.uploadAppArgsForCall = append(fake.uploadAppArgsForCall, struct {
appGuid string
zipFile *os.File
presentFiles []resources.AppFileResource
}{appGuid, zipFile, presentFiles})
fake.uploadAppMutex.Unlock()
if fake.UploadAppStub != nil {
return fake.UploadAppStub(appGuid, zipFile, presentFiles)
} else {
return fake.uploadAppReturns.result1
}
}
func (fake *FakePushActor) UploadAppCallCount() int {
fake.uploadAppMutex.RLock()
defer fake.uploadAppMutex.RUnlock()
return len(fake.uploadAppArgsForCall)
}
func (fake *FakePushActor) UploadAppArgsForCall(i int) (string, *os.File, []resources.AppFileResource) {
fake.uploadAppMutex.RLock()
defer fake.uploadAppMutex.RUnlock()
return fake.uploadAppArgsForCall[i].appGuid, fake.uploadAppArgsForCall[i].zipFile, fake.uploadAppArgsForCall[i].presentFiles
}
func (fake *FakePushActor) UploadAppReturns(result1 error) {
fake.UploadAppStub = nil
fake.uploadAppReturns = struct {
result1 error
}{result1}
}
func (fake *FakePushActor) ProcessPath(dirOrZipFile string, f func(string)) error {
fake.processPathMutex.Lock()
fake.processPathArgsForCall = append(fake.processPathArgsForCall, struct {
dirOrZipFile string
f func(string)
}{dirOrZipFile, f})
fake.processPathMutex.Unlock()
if fake.ProcessPathStub != nil {
return fake.ProcessPathStub(dirOrZipFile, f)
} else {
return fake.processPathReturns.result1
}
}
func (fake *FakePushActor) ProcessPathCallCount() int {
fake.processPathMutex.RLock()
defer fake.processPathMutex.RUnlock()
return len(fake.processPathArgsForCall)
}
func (fake *FakePushActor) ProcessPathArgsForCall(i int) (string, func(string)) {
fake.processPathMutex.RLock()
defer fake.processPathMutex.RUnlock()
return fake.processPathArgsForCall[i].dirOrZipFile, fake.processPathArgsForCall[i].f
}
func (fake *FakePushActor) ProcessPathReturns(result1 error) {
fake.ProcessPathStub = nil
fake.processPathReturns = struct {
result1 error
}{result1}
}
func (fake *FakePushActor) GatherFiles(localFiles []models.AppFileFields, appDir string, uploadDir string) ([]resources.AppFileResource, bool, error) {
fake.gatherFilesMutex.Lock()
fake.gatherFilesArgsForCall = append(fake.gatherFilesArgsForCall, struct {
localFiles []models.AppFileFields
appDir string
uploadDir string
}{localFiles, appDir, uploadDir})
fake.gatherFilesMutex.Unlock()
if fake.GatherFilesStub != nil {
return fake.GatherFilesStub(localFiles, appDir, uploadDir)
} else {
return fake.gatherFilesReturns.result1, fake.gatherFilesReturns.result2, fake.gatherFilesReturns.result3
}
}
func (fake *FakePushActor) GatherFilesCallCount() int {
fake.gatherFilesMutex.RLock()
defer fake.gatherFilesMutex.RUnlock()
return len(fake.gatherFilesArgsForCall)
}
func (fake *FakePushActor) GatherFilesArgsForCall(i int) ([]models.AppFileFields, string, string) {
fake.gatherFilesMutex.RLock()
defer fake.gatherFilesMutex.RUnlock()
return fake.gatherFilesArgsForCall[i].localFiles, fake.gatherFilesArgsForCall[i].appDir, fake.gatherFilesArgsForCall[i].uploadDir
}
func (fake *FakePushActor) GatherFilesReturns(result1 []resources.AppFileResource, result2 bool, result3 error) {
fake.GatherFilesStub = nil
fake.gatherFilesReturns = struct {
result1 []resources.AppFileResource
result2 bool
result3 error
}{result1, result2, result3}
}
var _ actors.PushActor = new(FakePushActor)