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>
307 lines
8.6 KiB
Go
307 lines
8.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 (
|
|
context "context"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
manager "github.com/ultravioletrs/cocos/manager"
|
|
)
|
|
|
|
// Service is an autogenerated mock type for the Service type
|
|
type Service struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type Service_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *Service) EXPECT() *Service_Expecter {
|
|
return &Service_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// FetchAttestationPolicy provides a mock function with given fields: ctx, computationID
|
|
func (_m *Service) FetchAttestationPolicy(ctx context.Context, computationID string) ([]byte, error) {
|
|
ret := _m.Called(ctx, computationID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for FetchAttestationPolicy")
|
|
}
|
|
|
|
var r0 []byte
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok {
|
|
return rf(ctx, computationID)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) []byte); ok {
|
|
r0 = rf(ctx, computationID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]byte)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, computationID)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Service_FetchAttestationPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchAttestationPolicy'
|
|
type Service_FetchAttestationPolicy_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// FetchAttestationPolicy is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - computationID string
|
|
func (_e *Service_Expecter) FetchAttestationPolicy(ctx interface{}, computationID interface{}) *Service_FetchAttestationPolicy_Call {
|
|
return &Service_FetchAttestationPolicy_Call{Call: _e.mock.On("FetchAttestationPolicy", ctx, computationID)}
|
|
}
|
|
|
|
func (_c *Service_FetchAttestationPolicy_Call) Run(run func(ctx context.Context, computationID string)) *Service_FetchAttestationPolicy_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *Service_FetchAttestationPolicy_Call) Return(_a0 []byte, _a1 error) *Service_FetchAttestationPolicy_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *Service_FetchAttestationPolicy_Call) RunAndReturn(run func(context.Context, string) ([]byte, error)) *Service_FetchAttestationPolicy_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// ReportBrokenConnection provides a mock function with given fields: addr
|
|
func (_m *Service) ReportBrokenConnection(addr string) {
|
|
_m.Called(addr)
|
|
}
|
|
|
|
// Service_ReportBrokenConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReportBrokenConnection'
|
|
type Service_ReportBrokenConnection_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ReportBrokenConnection is a helper method to define mock.On call
|
|
// - addr string
|
|
func (_e *Service_Expecter) ReportBrokenConnection(addr interface{}) *Service_ReportBrokenConnection_Call {
|
|
return &Service_ReportBrokenConnection_Call{Call: _e.mock.On("ReportBrokenConnection", addr)}
|
|
}
|
|
|
|
func (_c *Service_ReportBrokenConnection_Call) Run(run func(addr string)) *Service_ReportBrokenConnection_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *Service_ReportBrokenConnection_Call) Return() *Service_ReportBrokenConnection_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *Service_ReportBrokenConnection_Call) RunAndReturn(run func(string)) *Service_ReportBrokenConnection_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// ReturnSVMInfo provides a mock function with given fields: ctx
|
|
func (_m *Service) ReturnSVMInfo(ctx context.Context) (string, int, string, string) {
|
|
ret := _m.Called(ctx)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ReturnSVMInfo")
|
|
}
|
|
|
|
var r0 string
|
|
var r1 int
|
|
var r2 string
|
|
var r3 string
|
|
if rf, ok := ret.Get(0).(func(context.Context) (string, int, string, string)); ok {
|
|
return rf(ctx)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context) string); ok {
|
|
r0 = rf(ctx)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context) int); ok {
|
|
r1 = rf(ctx)
|
|
} else {
|
|
r1 = ret.Get(1).(int)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(context.Context) string); ok {
|
|
r2 = rf(ctx)
|
|
} else {
|
|
r2 = ret.Get(2).(string)
|
|
}
|
|
|
|
if rf, ok := ret.Get(3).(func(context.Context) string); ok {
|
|
r3 = rf(ctx)
|
|
} else {
|
|
r3 = ret.Get(3).(string)
|
|
}
|
|
|
|
return r0, r1, r2, r3
|
|
}
|
|
|
|
// Service_ReturnSVMInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReturnSVMInfo'
|
|
type Service_ReturnSVMInfo_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ReturnSVMInfo is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
func (_e *Service_Expecter) ReturnSVMInfo(ctx interface{}) *Service_ReturnSVMInfo_Call {
|
|
return &Service_ReturnSVMInfo_Call{Call: _e.mock.On("ReturnSVMInfo", ctx)}
|
|
}
|
|
|
|
func (_c *Service_ReturnSVMInfo_Call) Run(run func(ctx context.Context)) *Service_ReturnSVMInfo_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *Service_ReturnSVMInfo_Call) Return(_a0 string, _a1 int, _a2 string, _a3 string) *Service_ReturnSVMInfo_Call {
|
|
_c.Call.Return(_a0, _a1, _a2, _a3)
|
|
return _c
|
|
}
|
|
|
|
func (_c *Service_ReturnSVMInfo_Call) RunAndReturn(run func(context.Context) (string, int, string, string)) *Service_ReturnSVMInfo_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Run provides a mock function with given fields: ctx, c
|
|
func (_m *Service) Run(ctx context.Context, c *manager.ComputationRunReq) (string, error) {
|
|
ret := _m.Called(ctx, c)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Run")
|
|
}
|
|
|
|
var r0 string
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *manager.ComputationRunReq) (string, error)); ok {
|
|
return rf(ctx, c)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, *manager.ComputationRunReq) string); ok {
|
|
r0 = rf(ctx, c)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *manager.ComputationRunReq) error); ok {
|
|
r1 = rf(ctx, c)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Service_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run'
|
|
type Service_Run_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Run is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - c *manager.ComputationRunReq
|
|
func (_e *Service_Expecter) Run(ctx interface{}, c interface{}) *Service_Run_Call {
|
|
return &Service_Run_Call{Call: _e.mock.On("Run", ctx, c)}
|
|
}
|
|
|
|
func (_c *Service_Run_Call) Run(run func(ctx context.Context, c *manager.ComputationRunReq)) *Service_Run_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(*manager.ComputationRunReq))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *Service_Run_Call) Return(_a0 string, _a1 error) *Service_Run_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *Service_Run_Call) RunAndReturn(run func(context.Context, *manager.ComputationRunReq) (string, error)) *Service_Run_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Stop provides a mock function with given fields: ctx, computationID
|
|
func (_m *Service) Stop(ctx context.Context, computationID string) error {
|
|
ret := _m.Called(ctx, computationID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Stop")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
|
r0 = rf(ctx, computationID)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Service_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
|
|
type Service_Stop_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Stop is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - computationID string
|
|
func (_e *Service_Expecter) Stop(ctx interface{}, computationID interface{}) *Service_Stop_Call {
|
|
return &Service_Stop_Call{Call: _e.mock.On("Stop", ctx, computationID)}
|
|
}
|
|
|
|
func (_c *Service_Stop_Call) Run(run func(ctx context.Context, computationID string)) *Service_Stop_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *Service_Stop_Call) Return(_a0 error) *Service_Stop_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *Service_Stop_Call) RunAndReturn(run func(context.Context, string) error) *Service_Stop_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewService creates a new instance of Service. 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 NewService(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *Service {
|
|
mock := &Service{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|