mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
bceb1727d1
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
451 lines
10 KiB
Go
451 lines
10 KiB
Go
// Copyright (c) Ultraviolet
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Code generated by mockery v2.43.2. DO NOT EDIT.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
agent "github.com/ultravioletrs/cocos/agent"
|
|
manager "github.com/ultravioletrs/cocos/pkg/manager"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// VM is an autogenerated mock type for the VM type
|
|
type VM struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type VM_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *VM) EXPECT() *VM_Expecter {
|
|
return &VM_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// GetCID provides a mock function with given fields:
|
|
func (_m *VM) GetCID() int {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetCID")
|
|
}
|
|
|
|
var r0 int
|
|
if rf, ok := ret.Get(0).(func() int); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(int)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// VM_GetCID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCID'
|
|
type VM_GetCID_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetCID is a helper method to define mock.On call
|
|
func (_e *VM_Expecter) GetCID() *VM_GetCID_Call {
|
|
return &VM_GetCID_Call{Call: _e.mock.On("GetCID")}
|
|
}
|
|
|
|
func (_c *VM_GetCID_Call) Run(run func()) *VM_GetCID_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_GetCID_Call) Return(_a0 int) *VM_GetCID_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_GetCID_Call) RunAndReturn(run func() int) *VM_GetCID_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetConfig provides a mock function with given fields:
|
|
func (_m *VM) GetConfig() interface{} {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetConfig")
|
|
}
|
|
|
|
var r0 interface{}
|
|
if rf, ok := ret.Get(0).(func() interface{}); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(interface{})
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// VM_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig'
|
|
type VM_GetConfig_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetConfig is a helper method to define mock.On call
|
|
func (_e *VM_Expecter) GetConfig() *VM_GetConfig_Call {
|
|
return &VM_GetConfig_Call{Call: _e.mock.On("GetConfig")}
|
|
}
|
|
|
|
func (_c *VM_GetConfig_Call) Run(run func()) *VM_GetConfig_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_GetConfig_Call) Return(_a0 interface{}) *VM_GetConfig_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_GetConfig_Call) RunAndReturn(run func() interface{}) *VM_GetConfig_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetProcess provides a mock function with given fields:
|
|
func (_m *VM) GetProcess() int {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetProcess")
|
|
}
|
|
|
|
var r0 int
|
|
if rf, ok := ret.Get(0).(func() int); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(int)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// VM_GetProcess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProcess'
|
|
type VM_GetProcess_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetProcess is a helper method to define mock.On call
|
|
func (_e *VM_Expecter) GetProcess() *VM_GetProcess_Call {
|
|
return &VM_GetProcess_Call{Call: _e.mock.On("GetProcess")}
|
|
}
|
|
|
|
func (_c *VM_GetProcess_Call) Run(run func()) *VM_GetProcess_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_GetProcess_Call) Return(_a0 int) *VM_GetProcess_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_GetProcess_Call) RunAndReturn(run func() int) *VM_GetProcess_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// SendAgentConfig provides a mock function with given fields: ac
|
|
func (_m *VM) SendAgentConfig(ac agent.Computation) error {
|
|
ret := _m.Called(ac)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SendAgentConfig")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(agent.Computation) error); ok {
|
|
r0 = rf(ac)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// VM_SendAgentConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendAgentConfig'
|
|
type VM_SendAgentConfig_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// SendAgentConfig is a helper method to define mock.On call
|
|
// - ac agent.Computation
|
|
func (_e *VM_Expecter) SendAgentConfig(ac interface{}) *VM_SendAgentConfig_Call {
|
|
return &VM_SendAgentConfig_Call{Call: _e.mock.On("SendAgentConfig", ac)}
|
|
}
|
|
|
|
func (_c *VM_SendAgentConfig_Call) Run(run func(ac agent.Computation)) *VM_SendAgentConfig_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(agent.Computation))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_SendAgentConfig_Call) Return(_a0 error) *VM_SendAgentConfig_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_SendAgentConfig_Call) RunAndReturn(run func(agent.Computation) error) *VM_SendAgentConfig_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// SetProcess provides a mock function with given fields: pid
|
|
func (_m *VM) SetProcess(pid int) error {
|
|
ret := _m.Called(pid)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SetProcess")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(int) error); ok {
|
|
r0 = rf(pid)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// VM_SetProcess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetProcess'
|
|
type VM_SetProcess_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// SetProcess is a helper method to define mock.On call
|
|
// - pid int
|
|
func (_e *VM_Expecter) SetProcess(pid interface{}) *VM_SetProcess_Call {
|
|
return &VM_SetProcess_Call{Call: _e.mock.On("SetProcess", pid)}
|
|
}
|
|
|
|
func (_c *VM_SetProcess_Call) Run(run func(pid int)) *VM_SetProcess_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(int))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_SetProcess_Call) Return(_a0 error) *VM_SetProcess_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_SetProcess_Call) RunAndReturn(run func(int) error) *VM_SetProcess_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Start provides a mock function with given fields:
|
|
func (_m *VM) Start() error {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Start")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func() error); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// VM_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
|
|
type VM_Start_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Start is a helper method to define mock.On call
|
|
func (_e *VM_Expecter) Start() *VM_Start_Call {
|
|
return &VM_Start_Call{Call: _e.mock.On("Start")}
|
|
}
|
|
|
|
func (_c *VM_Start_Call) Run(run func()) *VM_Start_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_Start_Call) Return(_a0 error) *VM_Start_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_Start_Call) RunAndReturn(run func() error) *VM_Start_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// State provides a mock function with given fields:
|
|
func (_m *VM) State() string {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for State")
|
|
}
|
|
|
|
var r0 string
|
|
if rf, ok := ret.Get(0).(func() string); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// VM_State_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'State'
|
|
type VM_State_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// State is a helper method to define mock.On call
|
|
func (_e *VM_Expecter) State() *VM_State_Call {
|
|
return &VM_State_Call{Call: _e.mock.On("State")}
|
|
}
|
|
|
|
func (_c *VM_State_Call) Run(run func()) *VM_State_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_State_Call) Return(_a0 string) *VM_State_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_State_Call) RunAndReturn(run func() string) *VM_State_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Stop provides a mock function with given fields:
|
|
func (_m *VM) Stop() error {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Stop")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func() error); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// VM_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
|
|
type VM_Stop_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Stop is a helper method to define mock.On call
|
|
func (_e *VM_Expecter) Stop() *VM_Stop_Call {
|
|
return &VM_Stop_Call{Call: _e.mock.On("Stop")}
|
|
}
|
|
|
|
func (_c *VM_Stop_Call) Run(run func()) *VM_Stop_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_Stop_Call) Return(_a0 error) *VM_Stop_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_Stop_Call) RunAndReturn(run func() error) *VM_Stop_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Transition provides a mock function with given fields: newState
|
|
func (_m *VM) Transition(newState manager.ManagerState) error {
|
|
ret := _m.Called(newState)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Transition")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(manager.ManagerState) error); ok {
|
|
r0 = rf(newState)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// VM_Transition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transition'
|
|
type VM_Transition_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Transition is a helper method to define mock.On call
|
|
// - newState manager.ManagerState
|
|
func (_e *VM_Expecter) Transition(newState interface{}) *VM_Transition_Call {
|
|
return &VM_Transition_Call{Call: _e.mock.On("Transition", newState)}
|
|
}
|
|
|
|
func (_c *VM_Transition_Call) Run(run func(newState manager.ManagerState)) *VM_Transition_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(manager.ManagerState))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_Transition_Call) Return(_a0 error) *VM_Transition_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *VM_Transition_Call) RunAndReturn(run func(manager.ManagerState) error) *VM_Transition_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewVM creates a new instance of VM. 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 NewVM(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *VM {
|
|
mock := &VM{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|