executors/docker/internal/pull/mock_Manager.go (68 lines of code) (raw):
// Code generated by mockery v2.53.3. DO NOT EDIT.
package pull
import (
mock "github.com/stretchr/testify/mock"
common "gitlab.com/gitlab-org/gitlab-runner/common"
types "github.com/docker/docker/api/types"
)
// MockManager is an autogenerated mock type for the Manager type
type MockManager struct {
mock.Mock
}
type MockManager_Expecter struct {
mock *mock.Mock
}
func (_m *MockManager) EXPECT() *MockManager_Expecter {
return &MockManager_Expecter{mock: &_m.Mock}
}
// GetDockerImage provides a mock function with given fields: imageName, options, imagePullPolicies
func (_m *MockManager) GetDockerImage(imageName string, options common.ImageDockerOptions, imagePullPolicies []common.DockerPullPolicy) (*types.ImageInspect, error) {
ret := _m.Called(imageName, options, imagePullPolicies)
if len(ret) == 0 {
panic("no return value specified for GetDockerImage")
}
var r0 *types.ImageInspect
var r1 error
if rf, ok := ret.Get(0).(func(string, common.ImageDockerOptions, []common.DockerPullPolicy) (*types.ImageInspect, error)); ok {
return rf(imageName, options, imagePullPolicies)
}
if rf, ok := ret.Get(0).(func(string, common.ImageDockerOptions, []common.DockerPullPolicy) *types.ImageInspect); ok {
r0 = rf(imageName, options, imagePullPolicies)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ImageInspect)
}
}
if rf, ok := ret.Get(1).(func(string, common.ImageDockerOptions, []common.DockerPullPolicy) error); ok {
r1 = rf(imageName, options, imagePullPolicies)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockManager_GetDockerImage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDockerImage'
type MockManager_GetDockerImage_Call struct {
*mock.Call
}
// GetDockerImage is a helper method to define mock.On call
// - imageName string
// - options common.ImageDockerOptions
// - imagePullPolicies []common.DockerPullPolicy
func (_e *MockManager_Expecter) GetDockerImage(imageName interface{}, options interface{}, imagePullPolicies interface{}) *MockManager_GetDockerImage_Call {
return &MockManager_GetDockerImage_Call{Call: _e.mock.On("GetDockerImage", imageName, options, imagePullPolicies)}
}
func (_c *MockManager_GetDockerImage_Call) Run(run func(imageName string, options common.ImageDockerOptions, imagePullPolicies []common.DockerPullPolicy)) *MockManager_GetDockerImage_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(common.ImageDockerOptions), args[2].([]common.DockerPullPolicy))
})
return _c
}
func (_c *MockManager_GetDockerImage_Call) Return(_a0 *types.ImageInspect, _a1 error) *MockManager_GetDockerImage_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockManager_GetDockerImage_Call) RunAndReturn(run func(string, common.ImageDockerOptions, []common.DockerPullPolicy) (*types.ImageInspect, error)) *MockManager_GetDockerImage_Call {
_c.Call.Return(run)
return _c
}
// NewMockManager creates a new instance of MockManager. 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 NewMockManager(t interface {
mock.TestingT
Cleanup(func())
}) *MockManager {
mock := &MockManager{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}