-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmocks.go
More file actions
223 lines (185 loc) · 6.49 KB
/
mocks.go
File metadata and controls
223 lines (185 loc) · 6.49 KB
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package portal
import (
mock "github.com/stretchr/testify/mock"
"io"
"net/http"
)
// NewMockPortal creates a new instance of MockPortal. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockPortal(t interface {
mock.TestingT
Cleanup(func())
}) *MockPortal {
mock := &MockPortal{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockPortal is an autogenerated mock type for the Portal type
type MockPortal struct {
mock.Mock
}
type MockPortal_Expecter struct {
mock *mock.Mock
}
func (_m *MockPortal) EXPECT() *MockPortal_Expecter {
return &MockPortal_Expecter{mock: &_m.Mock}
}
// DownloadBuildArtifact provides a mock function for the type MockPortal
func (_mock *MockPortal) DownloadBuildArtifact(product Product, build Build, file io.Writer) error {
ret := _mock.Called(product, build, file)
if len(ret) == 0 {
panic("no return value specified for DownloadBuildArtifact")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(Product, Build, io.Writer) error); ok {
r0 = returnFunc(product, build, file)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockPortal_DownloadBuildArtifact_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DownloadBuildArtifact'
type MockPortal_DownloadBuildArtifact_Call struct {
*mock.Call
}
// DownloadBuildArtifact is a helper method to define mock.On call
// - product
// - build
// - file
func (_e *MockPortal_Expecter) DownloadBuildArtifact(product interface{}, build interface{}, file interface{}) *MockPortal_DownloadBuildArtifact_Call {
return &MockPortal_DownloadBuildArtifact_Call{Call: _e.mock.On("DownloadBuildArtifact", product, build, file)}
}
func (_c *MockPortal_DownloadBuildArtifact_Call) Run(run func(product Product, build Build, file io.Writer)) *MockPortal_DownloadBuildArtifact_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(Product), args[1].(Build), args[2].(io.Writer))
})
return _c
}
func (_c *MockPortal_DownloadBuildArtifact_Call) Return(err error) *MockPortal_DownloadBuildArtifact_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockPortal_DownloadBuildArtifact_Call) RunAndReturn(run func(product Product, build Build, file io.Writer) error) *MockPortal_DownloadBuildArtifact_Call {
_c.Call.Return(run)
return _c
}
// GetLatestBuild provides a mock function for the type MockPortal
func (_mock *MockPortal) GetLatestBuild(product Product, version string) (Build, error) {
ret := _mock.Called(product, version)
if len(ret) == 0 {
panic("no return value specified for GetLatestBuild")
}
var r0 Build
var r1 error
if returnFunc, ok := ret.Get(0).(func(Product, string) (Build, error)); ok {
return returnFunc(product, version)
}
if returnFunc, ok := ret.Get(0).(func(Product, string) Build); ok {
r0 = returnFunc(product, version)
} else {
r0 = ret.Get(0).(Build)
}
if returnFunc, ok := ret.Get(1).(func(Product, string) error); ok {
r1 = returnFunc(product, version)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockPortal_GetLatestBuild_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestBuild'
type MockPortal_GetLatestBuild_Call struct {
*mock.Call
}
// GetLatestBuild is a helper method to define mock.On call
// - product
// - version
func (_e *MockPortal_Expecter) GetLatestBuild(product interface{}, version interface{}) *MockPortal_GetLatestBuild_Call {
return &MockPortal_GetLatestBuild_Call{Call: _e.mock.On("GetLatestBuild", product, version)}
}
func (_c *MockPortal_GetLatestBuild_Call) Run(run func(product Product, version string)) *MockPortal_GetLatestBuild_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(Product), args[1].(string))
})
return _c
}
func (_c *MockPortal_GetLatestBuild_Call) Return(build Build, err error) *MockPortal_GetLatestBuild_Call {
_c.Call.Return(build, err)
return _c
}
func (_c *MockPortal_GetLatestBuild_Call) RunAndReturn(run func(product Product, version string) (Build, error)) *MockPortal_GetLatestBuild_Call {
_c.Call.Return(run)
return _c
}
// NewMockHttpClient creates a new instance of MockHttpClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockHttpClient(t interface {
mock.TestingT
Cleanup(func())
}) *MockHttpClient {
mock := &MockHttpClient{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockHttpClient is an autogenerated mock type for the HttpClient type
type MockHttpClient struct {
mock.Mock
}
type MockHttpClient_Expecter struct {
mock *mock.Mock
}
func (_m *MockHttpClient) EXPECT() *MockHttpClient_Expecter {
return &MockHttpClient_Expecter{mock: &_m.Mock}
}
// Do provides a mock function for the type MockHttpClient
func (_mock *MockHttpClient) Do(request *http.Request) (*http.Response, error) {
ret := _mock.Called(request)
if len(ret) == 0 {
panic("no return value specified for Do")
}
var r0 *http.Response
var r1 error
if returnFunc, ok := ret.Get(0).(func(*http.Request) (*http.Response, error)); ok {
return returnFunc(request)
}
if returnFunc, ok := ret.Get(0).(func(*http.Request) *http.Response); ok {
r0 = returnFunc(request)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*http.Response)
}
}
if returnFunc, ok := ret.Get(1).(func(*http.Request) error); ok {
r1 = returnFunc(request)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockHttpClient_Do_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Do'
type MockHttpClient_Do_Call struct {
*mock.Call
}
// Do is a helper method to define mock.On call
// - request
func (_e *MockHttpClient_Expecter) Do(request interface{}) *MockHttpClient_Do_Call {
return &MockHttpClient_Do_Call{Call: _e.mock.On("Do", request)}
}
func (_c *MockHttpClient_Do_Call) Run(run func(request *http.Request)) *MockHttpClient_Do_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*http.Request))
})
return _c
}
func (_c *MockHttpClient_Do_Call) Return(response *http.Response, err error) *MockHttpClient_Do_Call {
_c.Call.Return(response, err)
return _c
}
func (_c *MockHttpClient_Do_Call) RunAndReturn(run func(request *http.Request) (*http.Response, error)) *MockHttpClient_Do_Call {
_c.Call.Return(run)
return _c
}