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>
188 lines
4.6 KiB
Go
188 lines
4.6 KiB
Go
// Copyright (c) Ultraviolet
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Code generated by mockery v2.43.2. DO NOT EDIT.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
mock "github.com/stretchr/testify/mock"
|
|
qemu "github.com/ultravioletrs/cocos/manager/qemu"
|
|
)
|
|
|
|
// Persistence is an autogenerated mock type for the Persistence type
|
|
type Persistence struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type Persistence_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *Persistence) EXPECT() *Persistence_Expecter {
|
|
return &Persistence_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// DeleteVM provides a mock function with given fields: id
|
|
func (_m *Persistence) DeleteVM(id string) error {
|
|
ret := _m.Called(id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DeleteVM")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = rf(id)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Persistence_DeleteVM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteVM'
|
|
type Persistence_DeleteVM_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// DeleteVM is a helper method to define mock.On call
|
|
// - id string
|
|
func (_e *Persistence_Expecter) DeleteVM(id interface{}) *Persistence_DeleteVM_Call {
|
|
return &Persistence_DeleteVM_Call{Call: _e.mock.On("DeleteVM", id)}
|
|
}
|
|
|
|
func (_c *Persistence_DeleteVM_Call) Run(run func(id string)) *Persistence_DeleteVM_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *Persistence_DeleteVM_Call) Return(_a0 error) *Persistence_DeleteVM_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *Persistence_DeleteVM_Call) RunAndReturn(run func(string) error) *Persistence_DeleteVM_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// LoadVMs provides a mock function with given fields:
|
|
func (_m *Persistence) LoadVMs() ([]qemu.VMState, error) {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for LoadVMs")
|
|
}
|
|
|
|
var r0 []qemu.VMState
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func() ([]qemu.VMState, error)); ok {
|
|
return rf()
|
|
}
|
|
if rf, ok := ret.Get(0).(func() []qemu.VMState); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]qemu.VMState)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func() error); ok {
|
|
r1 = rf()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Persistence_LoadVMs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadVMs'
|
|
type Persistence_LoadVMs_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// LoadVMs is a helper method to define mock.On call
|
|
func (_e *Persistence_Expecter) LoadVMs() *Persistence_LoadVMs_Call {
|
|
return &Persistence_LoadVMs_Call{Call: _e.mock.On("LoadVMs")}
|
|
}
|
|
|
|
func (_c *Persistence_LoadVMs_Call) Run(run func()) *Persistence_LoadVMs_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *Persistence_LoadVMs_Call) Return(_a0 []qemu.VMState, _a1 error) *Persistence_LoadVMs_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *Persistence_LoadVMs_Call) RunAndReturn(run func() ([]qemu.VMState, error)) *Persistence_LoadVMs_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// SaveVM provides a mock function with given fields: state
|
|
func (_m *Persistence) SaveVM(state qemu.VMState) error {
|
|
ret := _m.Called(state)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SaveVM")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(qemu.VMState) error); ok {
|
|
r0 = rf(state)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Persistence_SaveVM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveVM'
|
|
type Persistence_SaveVM_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// SaveVM is a helper method to define mock.On call
|
|
// - state qemu.VMState
|
|
func (_e *Persistence_Expecter) SaveVM(state interface{}) *Persistence_SaveVM_Call {
|
|
return &Persistence_SaveVM_Call{Call: _e.mock.On("SaveVM", state)}
|
|
}
|
|
|
|
func (_c *Persistence_SaveVM_Call) Run(run func(state qemu.VMState)) *Persistence_SaveVM_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(qemu.VMState))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *Persistence_SaveVM_Call) Return(_a0 error) *Persistence_SaveVM_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *Persistence_SaveVM_Call) RunAndReturn(run func(qemu.VMState) error) *Persistence_SaveVM_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewPersistence creates a new instance of Persistence. 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 NewPersistence(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *Persistence {
|
|
mock := &Persistence{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|