common/mock_Shell.go (275 lines of code) (raw):

// Code generated by mockery v2.53.3. DO NOT EDIT. package common import ( context "context" mock "github.com/stretchr/testify/mock" ) // MockShell is an autogenerated mock type for the Shell type type MockShell struct { mock.Mock } type MockShell_Expecter struct { mock *mock.Mock } func (_m *MockShell) EXPECT() *MockShell_Expecter { return &MockShell_Expecter{mock: &_m.Mock} } // GenerateSaveScript provides a mock function with given fields: info, scriptPath, script func (_m *MockShell) GenerateSaveScript(info ShellScriptInfo, scriptPath string, script string) (string, error) { ret := _m.Called(info, scriptPath, script) if len(ret) == 0 { panic("no return value specified for GenerateSaveScript") } var r0 string var r1 error if rf, ok := ret.Get(0).(func(ShellScriptInfo, string, string) (string, error)); ok { return rf(info, scriptPath, script) } if rf, ok := ret.Get(0).(func(ShellScriptInfo, string, string) string); ok { r0 = rf(info, scriptPath, script) } else { r0 = ret.Get(0).(string) } if rf, ok := ret.Get(1).(func(ShellScriptInfo, string, string) error); ok { r1 = rf(info, scriptPath, script) } else { r1 = ret.Error(1) } return r0, r1 } // MockShell_GenerateSaveScript_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenerateSaveScript' type MockShell_GenerateSaveScript_Call struct { *mock.Call } // GenerateSaveScript is a helper method to define mock.On call // - info ShellScriptInfo // - scriptPath string // - script string func (_e *MockShell_Expecter) GenerateSaveScript(info interface{}, scriptPath interface{}, script interface{}) *MockShell_GenerateSaveScript_Call { return &MockShell_GenerateSaveScript_Call{Call: _e.mock.On("GenerateSaveScript", info, scriptPath, script)} } func (_c *MockShell_GenerateSaveScript_Call) Run(run func(info ShellScriptInfo, scriptPath string, script string)) *MockShell_GenerateSaveScript_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(ShellScriptInfo), args[1].(string), args[2].(string)) }) return _c } func (_c *MockShell_GenerateSaveScript_Call) Return(_a0 string, _a1 error) *MockShell_GenerateSaveScript_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockShell_GenerateSaveScript_Call) RunAndReturn(run func(ShellScriptInfo, string, string) (string, error)) *MockShell_GenerateSaveScript_Call { _c.Call.Return(run) return _c } // GenerateScript provides a mock function with given fields: ctx, buildStage, info func (_m *MockShell) GenerateScript(ctx context.Context, buildStage BuildStage, info ShellScriptInfo) (string, error) { ret := _m.Called(ctx, buildStage, info) if len(ret) == 0 { panic("no return value specified for GenerateScript") } var r0 string var r1 error if rf, ok := ret.Get(0).(func(context.Context, BuildStage, ShellScriptInfo) (string, error)); ok { return rf(ctx, buildStage, info) } if rf, ok := ret.Get(0).(func(context.Context, BuildStage, ShellScriptInfo) string); ok { r0 = rf(ctx, buildStage, info) } else { r0 = ret.Get(0).(string) } if rf, ok := ret.Get(1).(func(context.Context, BuildStage, ShellScriptInfo) error); ok { r1 = rf(ctx, buildStage, info) } else { r1 = ret.Error(1) } return r0, r1 } // MockShell_GenerateScript_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenerateScript' type MockShell_GenerateScript_Call struct { *mock.Call } // GenerateScript is a helper method to define mock.On call // - ctx context.Context // - buildStage BuildStage // - info ShellScriptInfo func (_e *MockShell_Expecter) GenerateScript(ctx interface{}, buildStage interface{}, info interface{}) *MockShell_GenerateScript_Call { return &MockShell_GenerateScript_Call{Call: _e.mock.On("GenerateScript", ctx, buildStage, info)} } func (_c *MockShell_GenerateScript_Call) Run(run func(ctx context.Context, buildStage BuildStage, info ShellScriptInfo)) *MockShell_GenerateScript_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(BuildStage), args[2].(ShellScriptInfo)) }) return _c } func (_c *MockShell_GenerateScript_Call) Return(_a0 string, _a1 error) *MockShell_GenerateScript_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockShell_GenerateScript_Call) RunAndReturn(run func(context.Context, BuildStage, ShellScriptInfo) (string, error)) *MockShell_GenerateScript_Call { _c.Call.Return(run) return _c } // GetConfiguration provides a mock function with given fields: info func (_m *MockShell) GetConfiguration(info ShellScriptInfo) (*ShellConfiguration, error) { ret := _m.Called(info) if len(ret) == 0 { panic("no return value specified for GetConfiguration") } var r0 *ShellConfiguration var r1 error if rf, ok := ret.Get(0).(func(ShellScriptInfo) (*ShellConfiguration, error)); ok { return rf(info) } if rf, ok := ret.Get(0).(func(ShellScriptInfo) *ShellConfiguration); ok { r0 = rf(info) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*ShellConfiguration) } } if rf, ok := ret.Get(1).(func(ShellScriptInfo) error); ok { r1 = rf(info) } else { r1 = ret.Error(1) } return r0, r1 } // MockShell_GetConfiguration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfiguration' type MockShell_GetConfiguration_Call struct { *mock.Call } // GetConfiguration is a helper method to define mock.On call // - info ShellScriptInfo func (_e *MockShell_Expecter) GetConfiguration(info interface{}) *MockShell_GetConfiguration_Call { return &MockShell_GetConfiguration_Call{Call: _e.mock.On("GetConfiguration", info)} } func (_c *MockShell_GetConfiguration_Call) Run(run func(info ShellScriptInfo)) *MockShell_GetConfiguration_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(ShellScriptInfo)) }) return _c } func (_c *MockShell_GetConfiguration_Call) Return(_a0 *ShellConfiguration, _a1 error) *MockShell_GetConfiguration_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockShell_GetConfiguration_Call) RunAndReturn(run func(ShellScriptInfo) (*ShellConfiguration, error)) *MockShell_GetConfiguration_Call { _c.Call.Return(run) return _c } // GetEntrypointCommand provides a mock function with given fields: info, probeFile func (_m *MockShell) GetEntrypointCommand(info ShellScriptInfo, probeFile string) []string { ret := _m.Called(info, probeFile) if len(ret) == 0 { panic("no return value specified for GetEntrypointCommand") } var r0 []string if rf, ok := ret.Get(0).(func(ShellScriptInfo, string) []string); ok { r0 = rf(info, probeFile) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]string) } } return r0 } // MockShell_GetEntrypointCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEntrypointCommand' type MockShell_GetEntrypointCommand_Call struct { *mock.Call } // GetEntrypointCommand is a helper method to define mock.On call // - info ShellScriptInfo // - probeFile string func (_e *MockShell_Expecter) GetEntrypointCommand(info interface{}, probeFile interface{}) *MockShell_GetEntrypointCommand_Call { return &MockShell_GetEntrypointCommand_Call{Call: _e.mock.On("GetEntrypointCommand", info, probeFile)} } func (_c *MockShell_GetEntrypointCommand_Call) Run(run func(info ShellScriptInfo, probeFile string)) *MockShell_GetEntrypointCommand_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(ShellScriptInfo), args[1].(string)) }) return _c } func (_c *MockShell_GetEntrypointCommand_Call) Return(_a0 []string) *MockShell_GetEntrypointCommand_Call { _c.Call.Return(_a0) return _c } func (_c *MockShell_GetEntrypointCommand_Call) RunAndReturn(run func(ShellScriptInfo, string) []string) *MockShell_GetEntrypointCommand_Call { _c.Call.Return(run) return _c } // GetFeatures provides a mock function with given fields: features func (_m *MockShell) GetFeatures(features *FeaturesInfo) { _m.Called(features) } // MockShell_GetFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeatures' type MockShell_GetFeatures_Call struct { *mock.Call } // GetFeatures is a helper method to define mock.On call // - features *FeaturesInfo func (_e *MockShell_Expecter) GetFeatures(features interface{}) *MockShell_GetFeatures_Call { return &MockShell_GetFeatures_Call{Call: _e.mock.On("GetFeatures", features)} } func (_c *MockShell_GetFeatures_Call) Run(run func(features *FeaturesInfo)) *MockShell_GetFeatures_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*FeaturesInfo)) }) return _c } func (_c *MockShell_GetFeatures_Call) Return() *MockShell_GetFeatures_Call { _c.Call.Return() return _c } func (_c *MockShell_GetFeatures_Call) RunAndReturn(run func(*FeaturesInfo)) *MockShell_GetFeatures_Call { _c.Run(run) return _c } // GetName provides a mock function with no fields func (_m *MockShell) GetName() string { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetName") } var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } return r0 } // MockShell_GetName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetName' type MockShell_GetName_Call struct { *mock.Call } // GetName is a helper method to define mock.On call func (_e *MockShell_Expecter) GetName() *MockShell_GetName_Call { return &MockShell_GetName_Call{Call: _e.mock.On("GetName")} } func (_c *MockShell_GetName_Call) Run(run func()) *MockShell_GetName_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockShell_GetName_Call) Return(_a0 string) *MockShell_GetName_Call { _c.Call.Return(_a0) return _c } func (_c *MockShell_GetName_Call) RunAndReturn(run func() string) *MockShell_GetName_Call { _c.Call.Return(run) return _c } // IsDefault provides a mock function with no fields func (_m *MockShell) IsDefault() bool { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for IsDefault") } var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() } else { r0 = ret.Get(0).(bool) } return r0 } // MockShell_IsDefault_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsDefault' type MockShell_IsDefault_Call struct { *mock.Call } // IsDefault is a helper method to define mock.On call func (_e *MockShell_Expecter) IsDefault() *MockShell_IsDefault_Call { return &MockShell_IsDefault_Call{Call: _e.mock.On("IsDefault")} } func (_c *MockShell_IsDefault_Call) Run(run func()) *MockShell_IsDefault_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockShell_IsDefault_Call) Return(_a0 bool) *MockShell_IsDefault_Call { _c.Call.Return(_a0) return _c } func (_c *MockShell_IsDefault_Call) RunAndReturn(run func() bool) *MockShell_IsDefault_Call { _c.Call.Return(run) return _c } // NewMockShell creates a new instance of MockShell. 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 NewMockShell(t interface { mock.TestingT Cleanup(func()) }) *MockShell { mock := &MockShell{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock }