1
0
mirror of https://codeberg.org/crowci/crow.git synced 2025-06-11 11:08:16 +03:00
Files
crow/server/logging/mocks/mock_Log.go
2025-03-10 13:58:57 +01:00

230 lines
6.1 KiB
Go

// Code generated by mockery v2.53.0. DO NOT EDIT.
package logging
import (
context "context"
logging "codeberg.org/crowci/crow/v3/server/logging"
mock "github.com/stretchr/testify/mock"
model "codeberg.org/crowci/crow/v3/server/model"
)
// MockLog is an autogenerated mock type for the Log type
type MockLog struct {
mock.Mock
}
type MockLog_Expecter struct {
mock *mock.Mock
}
func (_m *MockLog) EXPECT() *MockLog_Expecter {
return &MockLog_Expecter{mock: &_m.Mock}
}
// Close provides a mock function with given fields: c, stepID
func (_m *MockLog) Close(c context.Context, stepID int64) error {
ret := _m.Called(c, stepID)
if len(ret) == 0 {
panic("no return value specified for Close")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok {
r0 = rf(c, stepID)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockLog_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type MockLog_Close_Call struct {
*mock.Call
}
// Close is a helper method to define mock.On call
// - c context.Context
// - stepID int64
func (_e *MockLog_Expecter) Close(c interface{}, stepID interface{}) *MockLog_Close_Call {
return &MockLog_Close_Call{Call: _e.mock.On("Close", c, stepID)}
}
func (_c *MockLog_Close_Call) Run(run func(c context.Context, stepID int64)) *MockLog_Close_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(int64))
})
return _c
}
func (_c *MockLog_Close_Call) Return(_a0 error) *MockLog_Close_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockLog_Close_Call) RunAndReturn(run func(context.Context, int64) error) *MockLog_Close_Call {
_c.Call.Return(run)
return _c
}
// Open provides a mock function with given fields: c, stepID
func (_m *MockLog) Open(c context.Context, stepID int64) error {
ret := _m.Called(c, stepID)
if len(ret) == 0 {
panic("no return value specified for Open")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok {
r0 = rf(c, stepID)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockLog_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open'
type MockLog_Open_Call struct {
*mock.Call
}
// Open is a helper method to define mock.On call
// - c context.Context
// - stepID int64
func (_e *MockLog_Expecter) Open(c interface{}, stepID interface{}) *MockLog_Open_Call {
return &MockLog_Open_Call{Call: _e.mock.On("Open", c, stepID)}
}
func (_c *MockLog_Open_Call) Run(run func(c context.Context, stepID int64)) *MockLog_Open_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(int64))
})
return _c
}
func (_c *MockLog_Open_Call) Return(_a0 error) *MockLog_Open_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockLog_Open_Call) RunAndReturn(run func(context.Context, int64) error) *MockLog_Open_Call {
_c.Call.Return(run)
return _c
}
// Tail provides a mock function with given fields: c, stepID, handler
func (_m *MockLog) Tail(c context.Context, stepID int64, handler logging.LogChan) error {
ret := _m.Called(c, stepID, handler)
if len(ret) == 0 {
panic("no return value specified for Tail")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int64, logging.LogChan) error); ok {
r0 = rf(c, stepID, handler)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockLog_Tail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tail'
type MockLog_Tail_Call struct {
*mock.Call
}
// Tail is a helper method to define mock.On call
// - c context.Context
// - stepID int64
// - handler logging.LogChan
func (_e *MockLog_Expecter) Tail(c interface{}, stepID interface{}, handler interface{}) *MockLog_Tail_Call {
return &MockLog_Tail_Call{Call: _e.mock.On("Tail", c, stepID, handler)}
}
func (_c *MockLog_Tail_Call) Run(run func(c context.Context, stepID int64, handler logging.LogChan)) *MockLog_Tail_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(int64), args[2].(logging.LogChan))
})
return _c
}
func (_c *MockLog_Tail_Call) Return(_a0 error) *MockLog_Tail_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockLog_Tail_Call) RunAndReturn(run func(context.Context, int64, logging.LogChan) error) *MockLog_Tail_Call {
_c.Call.Return(run)
return _c
}
// Write provides a mock function with given fields: c, stepID, entries
func (_m *MockLog) Write(c context.Context, stepID int64, entries []*model.LogEntry) error {
ret := _m.Called(c, stepID, entries)
if len(ret) == 0 {
panic("no return value specified for Write")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int64, []*model.LogEntry) error); ok {
r0 = rf(c, stepID, entries)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockLog_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'
type MockLog_Write_Call struct {
*mock.Call
}
// Write is a helper method to define mock.On call
// - c context.Context
// - stepID int64
// - entries []*model.LogEntry
func (_e *MockLog_Expecter) Write(c interface{}, stepID interface{}, entries interface{}) *MockLog_Write_Call {
return &MockLog_Write_Call{Call: _e.mock.On("Write", c, stepID, entries)}
}
func (_c *MockLog_Write_Call) Run(run func(c context.Context, stepID int64, entries []*model.LogEntry)) *MockLog_Write_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(int64), args[2].([]*model.LogEntry))
})
return _c
}
func (_c *MockLog_Write_Call) Return(_a0 error) *MockLog_Write_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockLog_Write_Call) RunAndReturn(run func(context.Context, int64, []*model.LogEntry) error) *MockLog_Write_Call {
_c.Call.Return(run)
return _c
}
// NewMockLog creates a new instance of MockLog. 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 NewMockLog(t interface {
mock.TestingT
Cleanup(func())
}) *MockLog {
mock := &MockLog{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}