mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
d76074ae41
* add tests and mocks Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> fix ci Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> update test Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> fix(agent/grpc): revert change Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> fix ci Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> * refactor attestation and report tests Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> refactor tests Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> remove commented code Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> remove comment Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> remove comments * add test cases Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> export agent errors Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> remove comm Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> * fix tests Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> --------- Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
130 lines
2.9 KiB
Go
130 lines
2.9 KiB
Go
// Code generated by mockery v2.42.3. DO NOT EDIT.
|
|
|
|
// Copyright (c) Ultraviolet
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
|
|
agent "github.com/ultravioletrs/cocos/agent"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// Service is an autogenerated mock type for the Service type
|
|
type Service struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Algo provides a mock function with given fields: ctx, algorithm
|
|
func (_m *Service) Algo(ctx context.Context, algorithm agent.Algorithm) error {
|
|
ret := _m.Called(ctx, algorithm)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Algo")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, agent.Algorithm) error); ok {
|
|
r0 = rf(ctx, algorithm)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Attestation provides a mock function with given fields: ctx, reportData
|
|
func (_m *Service) Attestation(ctx context.Context, reportData [64]byte) ([]byte, error) {
|
|
ret := _m.Called(ctx, reportData)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Attestation")
|
|
}
|
|
|
|
var r0 []byte
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, [64]byte) ([]byte, error)); ok {
|
|
return rf(ctx, reportData)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, [64]byte) []byte); ok {
|
|
r0 = rf(ctx, reportData)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]byte)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, [64]byte) error); ok {
|
|
r1 = rf(ctx, reportData)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Data provides a mock function with given fields: ctx, dataset
|
|
func (_m *Service) Data(ctx context.Context, dataset agent.Dataset) error {
|
|
ret := _m.Called(ctx, dataset)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Data")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, agent.Dataset) error); ok {
|
|
r0 = rf(ctx, dataset)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Result provides a mock function with given fields: ctx
|
|
func (_m *Service) Result(ctx context.Context) ([]byte, error) {
|
|
ret := _m.Called(ctx)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Result")
|
|
}
|
|
|
|
var r0 []byte
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context) ([]byte, error)); ok {
|
|
return rf(ctx)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context) []byte); ok {
|
|
r0 = rf(ctx)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]byte)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
|
r1 = rf(ctx)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// 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
|
|
}
|