
* #155 refactor and synchronise writing to CodeOcean. * Reduce complexity of input parsing. * Update typo in internal/api/ws/codeocean_writer.go Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>
109 lines
2.3 KiB
Go
109 lines
2.3 KiB
Go
// Code generated by mockery v2.13.1. DO NOT EDIT.
|
|
|
|
package ws
|
|
|
|
import (
|
|
io "io"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// ConnectionMock is an autogenerated mock type for the Connection type
|
|
type ConnectionMock struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Close provides a mock function with given fields:
|
|
func (_m *ConnectionMock) Close() error {
|
|
ret := _m.Called()
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func() error); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// CloseHandler provides a mock function with given fields:
|
|
func (_m *ConnectionMock) CloseHandler() func(int, string) error {
|
|
ret := _m.Called()
|
|
|
|
var r0 func(int, string) error
|
|
if rf, ok := ret.Get(0).(func() func(int, string) error); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(func(int, string) error)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// NextReader provides a mock function with given fields:
|
|
func (_m *ConnectionMock) NextReader() (int, io.Reader, error) {
|
|
ret := _m.Called()
|
|
|
|
var r0 int
|
|
if rf, ok := ret.Get(0).(func() int); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(int)
|
|
}
|
|
|
|
var r1 io.Reader
|
|
if rf, ok := ret.Get(1).(func() io.Reader); ok {
|
|
r1 = rf()
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(io.Reader)
|
|
}
|
|
}
|
|
|
|
var r2 error
|
|
if rf, ok := ret.Get(2).(func() error); ok {
|
|
r2 = rf()
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SetCloseHandler provides a mock function with given fields: handler
|
|
func (_m *ConnectionMock) SetCloseHandler(handler func(int, string) error) {
|
|
_m.Called(handler)
|
|
}
|
|
|
|
// WriteMessage provides a mock function with given fields: messageType, data
|
|
func (_m *ConnectionMock) WriteMessage(messageType int, data []byte) error {
|
|
ret := _m.Called(messageType, data)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(int, []byte) error); ok {
|
|
r0 = rf(messageType, data)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
type mockConstructorTestingTNewConnectionMock interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}
|
|
|
|
// NewConnectionMock creates a new instance of ConnectionMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewConnectionMock(t mockConstructorTestingTNewConnectionMock) *ConnectionMock {
|
|
mock := &ConnectionMock{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|