github.com/argoproj/argo-cd/v3@v3.2.1/util/oci/mocks/Client.go (about) 1 // Code generated by mockery; DO NOT EDIT. 2 // github.com/vektra/mockery 3 // template: testify 4 5 package mocks 6 7 import ( 8 "context" 9 10 "github.com/argoproj/argo-cd/v3/util/io" 11 "github.com/opencontainers/image-spec/specs-go/v1" 12 mock "github.com/stretchr/testify/mock" 13 ) 14 15 // NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 16 // The first argument is typically a *testing.T value. 17 func NewClient(t interface { 18 mock.TestingT 19 Cleanup(func()) 20 }) *Client { 21 mock := &Client{} 22 mock.Mock.Test(t) 23 24 t.Cleanup(func() { mock.AssertExpectations(t) }) 25 26 return mock 27 } 28 29 // Client is an autogenerated mock type for the Client type 30 type Client struct { 31 mock.Mock 32 } 33 34 type Client_Expecter struct { 35 mock *mock.Mock 36 } 37 38 func (_m *Client) EXPECT() *Client_Expecter { 39 return &Client_Expecter{mock: &_m.Mock} 40 } 41 42 // CleanCache provides a mock function for the type Client 43 func (_mock *Client) CleanCache(revision string) error { 44 ret := _mock.Called(revision) 45 46 if len(ret) == 0 { 47 panic("no return value specified for CleanCache") 48 } 49 50 var r0 error 51 if returnFunc, ok := ret.Get(0).(func(string) error); ok { 52 r0 = returnFunc(revision) 53 } else { 54 r0 = ret.Error(0) 55 } 56 return r0 57 } 58 59 // Client_CleanCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CleanCache' 60 type Client_CleanCache_Call struct { 61 *mock.Call 62 } 63 64 // CleanCache is a helper method to define mock.On call 65 // - revision string 66 func (_e *Client_Expecter) CleanCache(revision interface{}) *Client_CleanCache_Call { 67 return &Client_CleanCache_Call{Call: _e.mock.On("CleanCache", revision)} 68 } 69 70 func (_c *Client_CleanCache_Call) Run(run func(revision string)) *Client_CleanCache_Call { 71 _c.Call.Run(func(args mock.Arguments) { 72 var arg0 string 73 if args[0] != nil { 74 arg0 = args[0].(string) 75 } 76 run( 77 arg0, 78 ) 79 }) 80 return _c 81 } 82 83 func (_c *Client_CleanCache_Call) Return(err error) *Client_CleanCache_Call { 84 _c.Call.Return(err) 85 return _c 86 } 87 88 func (_c *Client_CleanCache_Call) RunAndReturn(run func(revision string) error) *Client_CleanCache_Call { 89 _c.Call.Return(run) 90 return _c 91 } 92 93 // DigestMetadata provides a mock function for the type Client 94 func (_mock *Client) DigestMetadata(ctx context.Context, digest string) (*v1.Manifest, error) { 95 ret := _mock.Called(ctx, digest) 96 97 if len(ret) == 0 { 98 panic("no return value specified for DigestMetadata") 99 } 100 101 var r0 *v1.Manifest 102 var r1 error 103 if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*v1.Manifest, error)); ok { 104 return returnFunc(ctx, digest) 105 } 106 if returnFunc, ok := ret.Get(0).(func(context.Context, string) *v1.Manifest); ok { 107 r0 = returnFunc(ctx, digest) 108 } else { 109 if ret.Get(0) != nil { 110 r0 = ret.Get(0).(*v1.Manifest) 111 } 112 } 113 if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { 114 r1 = returnFunc(ctx, digest) 115 } else { 116 r1 = ret.Error(1) 117 } 118 return r0, r1 119 } 120 121 // Client_DigestMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DigestMetadata' 122 type Client_DigestMetadata_Call struct { 123 *mock.Call 124 } 125 126 // DigestMetadata is a helper method to define mock.On call 127 // - ctx context.Context 128 // - digest string 129 func (_e *Client_Expecter) DigestMetadata(ctx interface{}, digest interface{}) *Client_DigestMetadata_Call { 130 return &Client_DigestMetadata_Call{Call: _e.mock.On("DigestMetadata", ctx, digest)} 131 } 132 133 func (_c *Client_DigestMetadata_Call) Run(run func(ctx context.Context, digest string)) *Client_DigestMetadata_Call { 134 _c.Call.Run(func(args mock.Arguments) { 135 var arg0 context.Context 136 if args[0] != nil { 137 arg0 = args[0].(context.Context) 138 } 139 var arg1 string 140 if args[1] != nil { 141 arg1 = args[1].(string) 142 } 143 run( 144 arg0, 145 arg1, 146 ) 147 }) 148 return _c 149 } 150 151 func (_c *Client_DigestMetadata_Call) Return(manifest *v1.Manifest, err error) *Client_DigestMetadata_Call { 152 _c.Call.Return(manifest, err) 153 return _c 154 } 155 156 func (_c *Client_DigestMetadata_Call) RunAndReturn(run func(ctx context.Context, digest string) (*v1.Manifest, error)) *Client_DigestMetadata_Call { 157 _c.Call.Return(run) 158 return _c 159 } 160 161 // Extract provides a mock function for the type Client 162 func (_mock *Client) Extract(ctx context.Context, revision string) (string, io.Closer, error) { 163 ret := _mock.Called(ctx, revision) 164 165 if len(ret) == 0 { 166 panic("no return value specified for Extract") 167 } 168 169 var r0 string 170 var r1 io.Closer 171 var r2 error 172 if returnFunc, ok := ret.Get(0).(func(context.Context, string) (string, io.Closer, error)); ok { 173 return returnFunc(ctx, revision) 174 } 175 if returnFunc, ok := ret.Get(0).(func(context.Context, string) string); ok { 176 r0 = returnFunc(ctx, revision) 177 } else { 178 r0 = ret.Get(0).(string) 179 } 180 if returnFunc, ok := ret.Get(1).(func(context.Context, string) io.Closer); ok { 181 r1 = returnFunc(ctx, revision) 182 } else { 183 if ret.Get(1) != nil { 184 r1 = ret.Get(1).(io.Closer) 185 } 186 } 187 if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok { 188 r2 = returnFunc(ctx, revision) 189 } else { 190 r2 = ret.Error(2) 191 } 192 return r0, r1, r2 193 } 194 195 // Client_Extract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Extract' 196 type Client_Extract_Call struct { 197 *mock.Call 198 } 199 200 // Extract is a helper method to define mock.On call 201 // - ctx context.Context 202 // - revision string 203 func (_e *Client_Expecter) Extract(ctx interface{}, revision interface{}) *Client_Extract_Call { 204 return &Client_Extract_Call{Call: _e.mock.On("Extract", ctx, revision)} 205 } 206 207 func (_c *Client_Extract_Call) Run(run func(ctx context.Context, revision string)) *Client_Extract_Call { 208 _c.Call.Run(func(args mock.Arguments) { 209 var arg0 context.Context 210 if args[0] != nil { 211 arg0 = args[0].(context.Context) 212 } 213 var arg1 string 214 if args[1] != nil { 215 arg1 = args[1].(string) 216 } 217 run( 218 arg0, 219 arg1, 220 ) 221 }) 222 return _c 223 } 224 225 func (_c *Client_Extract_Call) Return(s string, closer io.Closer, err error) *Client_Extract_Call { 226 _c.Call.Return(s, closer, err) 227 return _c 228 } 229 230 func (_c *Client_Extract_Call) RunAndReturn(run func(ctx context.Context, revision string) (string, io.Closer, error)) *Client_Extract_Call { 231 _c.Call.Return(run) 232 return _c 233 } 234 235 // GetTags provides a mock function for the type Client 236 func (_mock *Client) GetTags(ctx context.Context, noCache bool) ([]string, error) { 237 ret := _mock.Called(ctx, noCache) 238 239 if len(ret) == 0 { 240 panic("no return value specified for GetTags") 241 } 242 243 var r0 []string 244 var r1 error 245 if returnFunc, ok := ret.Get(0).(func(context.Context, bool) ([]string, error)); ok { 246 return returnFunc(ctx, noCache) 247 } 248 if returnFunc, ok := ret.Get(0).(func(context.Context, bool) []string); ok { 249 r0 = returnFunc(ctx, noCache) 250 } else { 251 if ret.Get(0) != nil { 252 r0 = ret.Get(0).([]string) 253 } 254 } 255 if returnFunc, ok := ret.Get(1).(func(context.Context, bool) error); ok { 256 r1 = returnFunc(ctx, noCache) 257 } else { 258 r1 = ret.Error(1) 259 } 260 return r0, r1 261 } 262 263 // Client_GetTags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTags' 264 type Client_GetTags_Call struct { 265 *mock.Call 266 } 267 268 // GetTags is a helper method to define mock.On call 269 // - ctx context.Context 270 // - noCache bool 271 func (_e *Client_Expecter) GetTags(ctx interface{}, noCache interface{}) *Client_GetTags_Call { 272 return &Client_GetTags_Call{Call: _e.mock.On("GetTags", ctx, noCache)} 273 } 274 275 func (_c *Client_GetTags_Call) Run(run func(ctx context.Context, noCache bool)) *Client_GetTags_Call { 276 _c.Call.Run(func(args mock.Arguments) { 277 var arg0 context.Context 278 if args[0] != nil { 279 arg0 = args[0].(context.Context) 280 } 281 var arg1 bool 282 if args[1] != nil { 283 arg1 = args[1].(bool) 284 } 285 run( 286 arg0, 287 arg1, 288 ) 289 }) 290 return _c 291 } 292 293 func (_c *Client_GetTags_Call) Return(strings []string, err error) *Client_GetTags_Call { 294 _c.Call.Return(strings, err) 295 return _c 296 } 297 298 func (_c *Client_GetTags_Call) RunAndReturn(run func(ctx context.Context, noCache bool) ([]string, error)) *Client_GetTags_Call { 299 _c.Call.Return(run) 300 return _c 301 } 302 303 // ResolveRevision provides a mock function for the type Client 304 func (_mock *Client) ResolveRevision(ctx context.Context, revision string, noCache bool) (string, error) { 305 ret := _mock.Called(ctx, revision, noCache) 306 307 if len(ret) == 0 { 308 panic("no return value specified for ResolveRevision") 309 } 310 311 var r0 string 312 var r1 error 313 if returnFunc, ok := ret.Get(0).(func(context.Context, string, bool) (string, error)); ok { 314 return returnFunc(ctx, revision, noCache) 315 } 316 if returnFunc, ok := ret.Get(0).(func(context.Context, string, bool) string); ok { 317 r0 = returnFunc(ctx, revision, noCache) 318 } else { 319 r0 = ret.Get(0).(string) 320 } 321 if returnFunc, ok := ret.Get(1).(func(context.Context, string, bool) error); ok { 322 r1 = returnFunc(ctx, revision, noCache) 323 } else { 324 r1 = ret.Error(1) 325 } 326 return r0, r1 327 } 328 329 // Client_ResolveRevision_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResolveRevision' 330 type Client_ResolveRevision_Call struct { 331 *mock.Call 332 } 333 334 // ResolveRevision is a helper method to define mock.On call 335 // - ctx context.Context 336 // - revision string 337 // - noCache bool 338 func (_e *Client_Expecter) ResolveRevision(ctx interface{}, revision interface{}, noCache interface{}) *Client_ResolveRevision_Call { 339 return &Client_ResolveRevision_Call{Call: _e.mock.On("ResolveRevision", ctx, revision, noCache)} 340 } 341 342 func (_c *Client_ResolveRevision_Call) Run(run func(ctx context.Context, revision string, noCache bool)) *Client_ResolveRevision_Call { 343 _c.Call.Run(func(args mock.Arguments) { 344 var arg0 context.Context 345 if args[0] != nil { 346 arg0 = args[0].(context.Context) 347 } 348 var arg1 string 349 if args[1] != nil { 350 arg1 = args[1].(string) 351 } 352 var arg2 bool 353 if args[2] != nil { 354 arg2 = args[2].(bool) 355 } 356 run( 357 arg0, 358 arg1, 359 arg2, 360 ) 361 }) 362 return _c 363 } 364 365 func (_c *Client_ResolveRevision_Call) Return(s string, err error) *Client_ResolveRevision_Call { 366 _c.Call.Return(s, err) 367 return _c 368 } 369 370 func (_c *Client_ResolveRevision_Call) RunAndReturn(run func(ctx context.Context, revision string, noCache bool) (string, error)) *Client_ResolveRevision_Call { 371 _c.Call.Return(run) 372 return _c 373 } 374 375 // TestRepo provides a mock function for the type Client 376 func (_mock *Client) TestRepo(ctx context.Context) (bool, error) { 377 ret := _mock.Called(ctx) 378 379 if len(ret) == 0 { 380 panic("no return value specified for TestRepo") 381 } 382 383 var r0 bool 384 var r1 error 385 if returnFunc, ok := ret.Get(0).(func(context.Context) (bool, error)); ok { 386 return returnFunc(ctx) 387 } 388 if returnFunc, ok := ret.Get(0).(func(context.Context) bool); ok { 389 r0 = returnFunc(ctx) 390 } else { 391 r0 = ret.Get(0).(bool) 392 } 393 if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { 394 r1 = returnFunc(ctx) 395 } else { 396 r1 = ret.Error(1) 397 } 398 return r0, r1 399 } 400 401 // Client_TestRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TestRepo' 402 type Client_TestRepo_Call struct { 403 *mock.Call 404 } 405 406 // TestRepo is a helper method to define mock.On call 407 // - ctx context.Context 408 func (_e *Client_Expecter) TestRepo(ctx interface{}) *Client_TestRepo_Call { 409 return &Client_TestRepo_Call{Call: _e.mock.On("TestRepo", ctx)} 410 } 411 412 func (_c *Client_TestRepo_Call) Run(run func(ctx context.Context)) *Client_TestRepo_Call { 413 _c.Call.Run(func(args mock.Arguments) { 414 var arg0 context.Context 415 if args[0] != nil { 416 arg0 = args[0].(context.Context) 417 } 418 run( 419 arg0, 420 ) 421 }) 422 return _c 423 } 424 425 func (_c *Client_TestRepo_Call) Return(b bool, err error) *Client_TestRepo_Call { 426 _c.Call.Return(b, err) 427 return _c 428 } 429 430 func (_c *Client_TestRepo_Call) RunAndReturn(run func(ctx context.Context) (bool, error)) *Client_TestRepo_Call { 431 _c.Call.Return(run) 432 return _c 433 }