Files
opencloud/services/graph/mocks/storage.go

733 lines
21 KiB
Go

// Code generated by mockery. DO NOT EDIT.
package mocks
import (
context "context"
metadata "github.com/opencloud-eu/reva/v2/pkg/storage/utils/metadata"
mock "github.com/stretchr/testify/mock"
providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
)
// Storage is an autogenerated mock type for the Storage type
type Storage struct {
mock.Mock
}
type Storage_Expecter struct {
mock *mock.Mock
}
func (_m *Storage) EXPECT() *Storage_Expecter {
return &Storage_Expecter{mock: &_m.Mock}
}
// Backend provides a mock function with no fields
func (_m *Storage) Backend() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Backend")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// Storage_Backend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Backend'
type Storage_Backend_Call struct {
*mock.Call
}
// Backend is a helper method to define mock.On call
func (_e *Storage_Expecter) Backend() *Storage_Backend_Call {
return &Storage_Backend_Call{Call: _e.mock.On("Backend")}
}
func (_c *Storage_Backend_Call) Run(run func()) *Storage_Backend_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *Storage_Backend_Call) Return(_a0 string) *Storage_Backend_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Storage_Backend_Call) RunAndReturn(run func() string) *Storage_Backend_Call {
_c.Call.Return(run)
return _c
}
// CreateSymlink provides a mock function with given fields: ctx, oldname, newname
func (_m *Storage) CreateSymlink(ctx context.Context, oldname string, newname string) error {
ret := _m.Called(ctx, oldname, newname)
if len(ret) == 0 {
panic("no return value specified for CreateSymlink")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
r0 = rf(ctx, oldname, newname)
} else {
r0 = ret.Error(0)
}
return r0
}
// Storage_CreateSymlink_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSymlink'
type Storage_CreateSymlink_Call struct {
*mock.Call
}
// CreateSymlink is a helper method to define mock.On call
// - ctx context.Context
// - oldname string
// - newname string
func (_e *Storage_Expecter) CreateSymlink(ctx interface{}, oldname interface{}, newname interface{}) *Storage_CreateSymlink_Call {
return &Storage_CreateSymlink_Call{Call: _e.mock.On("CreateSymlink", ctx, oldname, newname)}
}
func (_c *Storage_CreateSymlink_Call) Run(run func(ctx context.Context, oldname string, newname string)) *Storage_CreateSymlink_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(string))
})
return _c
}
func (_c *Storage_CreateSymlink_Call) Return(_a0 error) *Storage_CreateSymlink_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Storage_CreateSymlink_Call) RunAndReturn(run func(context.Context, string, string) error) *Storage_CreateSymlink_Call {
_c.Call.Return(run)
return _c
}
// Delete provides a mock function with given fields: ctx, path
func (_m *Storage) Delete(ctx context.Context, path string) error {
ret := _m.Called(ctx, path)
if len(ret) == 0 {
panic("no return value specified for Delete")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, path)
} else {
r0 = ret.Error(0)
}
return r0
}
// Storage_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
type Storage_Delete_Call struct {
*mock.Call
}
// Delete is a helper method to define mock.On call
// - ctx context.Context
// - path string
func (_e *Storage_Expecter) Delete(ctx interface{}, path interface{}) *Storage_Delete_Call {
return &Storage_Delete_Call{Call: _e.mock.On("Delete", ctx, path)}
}
func (_c *Storage_Delete_Call) Run(run func(ctx context.Context, path string)) *Storage_Delete_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *Storage_Delete_Call) Return(_a0 error) *Storage_Delete_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Storage_Delete_Call) RunAndReturn(run func(context.Context, string) error) *Storage_Delete_Call {
_c.Call.Return(run)
return _c
}
// Download provides a mock function with given fields: ctx, req
func (_m *Storage) Download(ctx context.Context, req metadata.DownloadRequest) (*metadata.DownloadResponse, error) {
ret := _m.Called(ctx, req)
if len(ret) == 0 {
panic("no return value specified for Download")
}
var r0 *metadata.DownloadResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) (*metadata.DownloadResponse, error)); ok {
return rf(ctx, req)
}
if rf, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) *metadata.DownloadResponse); ok {
r0 = rf(ctx, req)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*metadata.DownloadResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, metadata.DownloadRequest) error); ok {
r1 = rf(ctx, req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_Download_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Download'
type Storage_Download_Call struct {
*mock.Call
}
// Download is a helper method to define mock.On call
// - ctx context.Context
// - req metadata.DownloadRequest
func (_e *Storage_Expecter) Download(ctx interface{}, req interface{}) *Storage_Download_Call {
return &Storage_Download_Call{Call: _e.mock.On("Download", ctx, req)}
}
func (_c *Storage_Download_Call) Run(run func(ctx context.Context, req metadata.DownloadRequest)) *Storage_Download_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(metadata.DownloadRequest))
})
return _c
}
func (_c *Storage_Download_Call) Return(_a0 *metadata.DownloadResponse, _a1 error) *Storage_Download_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Storage_Download_Call) RunAndReturn(run func(context.Context, metadata.DownloadRequest) (*metadata.DownloadResponse, error)) *Storage_Download_Call {
_c.Call.Return(run)
return _c
}
// Init provides a mock function with given fields: ctx, name
func (_m *Storage) Init(ctx context.Context, name string) error {
ret := _m.Called(ctx, name)
if len(ret) == 0 {
panic("no return value specified for Init")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, name)
} else {
r0 = ret.Error(0)
}
return r0
}
// Storage_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init'
type Storage_Init_Call struct {
*mock.Call
}
// Init is a helper method to define mock.On call
// - ctx context.Context
// - name string
func (_e *Storage_Expecter) Init(ctx interface{}, name interface{}) *Storage_Init_Call {
return &Storage_Init_Call{Call: _e.mock.On("Init", ctx, name)}
}
func (_c *Storage_Init_Call) Run(run func(ctx context.Context, name string)) *Storage_Init_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *Storage_Init_Call) Return(err error) *Storage_Init_Call {
_c.Call.Return(err)
return _c
}
func (_c *Storage_Init_Call) RunAndReturn(run func(context.Context, string) error) *Storage_Init_Call {
_c.Call.Return(run)
return _c
}
// ListDir provides a mock function with given fields: ctx, path
func (_m *Storage) ListDir(ctx context.Context, path string) ([]*providerv1beta1.ResourceInfo, error) {
ret := _m.Called(ctx, path)
if len(ret) == 0 {
panic("no return value specified for ListDir")
}
var r0 []*providerv1beta1.ResourceInfo
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) ([]*providerv1beta1.ResourceInfo, error)); ok {
return rf(ctx, path)
}
if rf, ok := ret.Get(0).(func(context.Context, string) []*providerv1beta1.ResourceInfo); ok {
r0 = rf(ctx, path)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*providerv1beta1.ResourceInfo)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_ListDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDir'
type Storage_ListDir_Call struct {
*mock.Call
}
// ListDir is a helper method to define mock.On call
// - ctx context.Context
// - path string
func (_e *Storage_Expecter) ListDir(ctx interface{}, path interface{}) *Storage_ListDir_Call {
return &Storage_ListDir_Call{Call: _e.mock.On("ListDir", ctx, path)}
}
func (_c *Storage_ListDir_Call) Run(run func(ctx context.Context, path string)) *Storage_ListDir_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *Storage_ListDir_Call) Return(_a0 []*providerv1beta1.ResourceInfo, _a1 error) *Storage_ListDir_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Storage_ListDir_Call) RunAndReturn(run func(context.Context, string) ([]*providerv1beta1.ResourceInfo, error)) *Storage_ListDir_Call {
_c.Call.Return(run)
return _c
}
// MakeDirIfNotExist provides a mock function with given fields: ctx, name
func (_m *Storage) MakeDirIfNotExist(ctx context.Context, name string) error {
ret := _m.Called(ctx, name)
if len(ret) == 0 {
panic("no return value specified for MakeDirIfNotExist")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, name)
} else {
r0 = ret.Error(0)
}
return r0
}
// Storage_MakeDirIfNotExist_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeDirIfNotExist'
type Storage_MakeDirIfNotExist_Call struct {
*mock.Call
}
// MakeDirIfNotExist is a helper method to define mock.On call
// - ctx context.Context
// - name string
func (_e *Storage_Expecter) MakeDirIfNotExist(ctx interface{}, name interface{}) *Storage_MakeDirIfNotExist_Call {
return &Storage_MakeDirIfNotExist_Call{Call: _e.mock.On("MakeDirIfNotExist", ctx, name)}
}
func (_c *Storage_MakeDirIfNotExist_Call) Run(run func(ctx context.Context, name string)) *Storage_MakeDirIfNotExist_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *Storage_MakeDirIfNotExist_Call) Return(_a0 error) *Storage_MakeDirIfNotExist_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Storage_MakeDirIfNotExist_Call) RunAndReturn(run func(context.Context, string) error) *Storage_MakeDirIfNotExist_Call {
_c.Call.Return(run)
return _c
}
// ReadDir provides a mock function with given fields: ctx, path
func (_m *Storage) ReadDir(ctx context.Context, path string) ([]string, error) {
ret := _m.Called(ctx, path)
if len(ret) == 0 {
panic("no return value specified for ReadDir")
}
var r0 []string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) ([]string, error)); ok {
return rf(ctx, path)
}
if rf, ok := ret.Get(0).(func(context.Context, string) []string); ok {
r0 = rf(ctx, path)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_ReadDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadDir'
type Storage_ReadDir_Call struct {
*mock.Call
}
// ReadDir is a helper method to define mock.On call
// - ctx context.Context
// - path string
func (_e *Storage_Expecter) ReadDir(ctx interface{}, path interface{}) *Storage_ReadDir_Call {
return &Storage_ReadDir_Call{Call: _e.mock.On("ReadDir", ctx, path)}
}
func (_c *Storage_ReadDir_Call) Run(run func(ctx context.Context, path string)) *Storage_ReadDir_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *Storage_ReadDir_Call) Return(_a0 []string, _a1 error) *Storage_ReadDir_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Storage_ReadDir_Call) RunAndReturn(run func(context.Context, string) ([]string, error)) *Storage_ReadDir_Call {
_c.Call.Return(run)
return _c
}
// ResolveSymlink provides a mock function with given fields: ctx, name
func (_m *Storage) ResolveSymlink(ctx context.Context, name string) (string, error) {
ret := _m.Called(ctx, name)
if len(ret) == 0 {
panic("no return value specified for ResolveSymlink")
}
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok {
return rf(ctx, name)
}
if rf, ok := ret.Get(0).(func(context.Context, string) string); ok {
r0 = rf(ctx, name)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, name)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_ResolveSymlink_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResolveSymlink'
type Storage_ResolveSymlink_Call struct {
*mock.Call
}
// ResolveSymlink is a helper method to define mock.On call
// - ctx context.Context
// - name string
func (_e *Storage_Expecter) ResolveSymlink(ctx interface{}, name interface{}) *Storage_ResolveSymlink_Call {
return &Storage_ResolveSymlink_Call{Call: _e.mock.On("ResolveSymlink", ctx, name)}
}
func (_c *Storage_ResolveSymlink_Call) Run(run func(ctx context.Context, name string)) *Storage_ResolveSymlink_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *Storage_ResolveSymlink_Call) Return(_a0 string, _a1 error) *Storage_ResolveSymlink_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Storage_ResolveSymlink_Call) RunAndReturn(run func(context.Context, string) (string, error)) *Storage_ResolveSymlink_Call {
_c.Call.Return(run)
return _c
}
// SimpleDownload provides a mock function with given fields: ctx, path
func (_m *Storage) SimpleDownload(ctx context.Context, path string) ([]byte, error) {
ret := _m.Called(ctx, path)
if len(ret) == 0 {
panic("no return value specified for SimpleDownload")
}
var r0 []byte
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok {
return rf(ctx, path)
}
if rf, ok := ret.Get(0).(func(context.Context, string) []byte); ok {
r0 = rf(ctx, path)
} 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, path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_SimpleDownload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SimpleDownload'
type Storage_SimpleDownload_Call struct {
*mock.Call
}
// SimpleDownload is a helper method to define mock.On call
// - ctx context.Context
// - path string
func (_e *Storage_Expecter) SimpleDownload(ctx interface{}, path interface{}) *Storage_SimpleDownload_Call {
return &Storage_SimpleDownload_Call{Call: _e.mock.On("SimpleDownload", ctx, path)}
}
func (_c *Storage_SimpleDownload_Call) Run(run func(ctx context.Context, path string)) *Storage_SimpleDownload_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *Storage_SimpleDownload_Call) Return(_a0 []byte, _a1 error) *Storage_SimpleDownload_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Storage_SimpleDownload_Call) RunAndReturn(run func(context.Context, string) ([]byte, error)) *Storage_SimpleDownload_Call {
_c.Call.Return(run)
return _c
}
// SimpleUpload provides a mock function with given fields: ctx, uploadpath, content
func (_m *Storage) SimpleUpload(ctx context.Context, uploadpath string, content []byte) error {
ret := _m.Called(ctx, uploadpath, content)
if len(ret) == 0 {
panic("no return value specified for SimpleUpload")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok {
r0 = rf(ctx, uploadpath, content)
} else {
r0 = ret.Error(0)
}
return r0
}
// Storage_SimpleUpload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SimpleUpload'
type Storage_SimpleUpload_Call struct {
*mock.Call
}
// SimpleUpload is a helper method to define mock.On call
// - ctx context.Context
// - uploadpath string
// - content []byte
func (_e *Storage_Expecter) SimpleUpload(ctx interface{}, uploadpath interface{}, content interface{}) *Storage_SimpleUpload_Call {
return &Storage_SimpleUpload_Call{Call: _e.mock.On("SimpleUpload", ctx, uploadpath, content)}
}
func (_c *Storage_SimpleUpload_Call) Run(run func(ctx context.Context, uploadpath string, content []byte)) *Storage_SimpleUpload_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].([]byte))
})
return _c
}
func (_c *Storage_SimpleUpload_Call) Return(_a0 error) *Storage_SimpleUpload_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Storage_SimpleUpload_Call) RunAndReturn(run func(context.Context, string, []byte) error) *Storage_SimpleUpload_Call {
_c.Call.Return(run)
return _c
}
// Stat provides a mock function with given fields: ctx, path
func (_m *Storage) Stat(ctx context.Context, path string) (*providerv1beta1.ResourceInfo, error) {
ret := _m.Called(ctx, path)
if len(ret) == 0 {
panic("no return value specified for Stat")
}
var r0 *providerv1beta1.ResourceInfo
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*providerv1beta1.ResourceInfo, error)); ok {
return rf(ctx, path)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *providerv1beta1.ResourceInfo); ok {
r0 = rf(ctx, path)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*providerv1beta1.ResourceInfo)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_Stat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stat'
type Storage_Stat_Call struct {
*mock.Call
}
// Stat is a helper method to define mock.On call
// - ctx context.Context
// - path string
func (_e *Storage_Expecter) Stat(ctx interface{}, path interface{}) *Storage_Stat_Call {
return &Storage_Stat_Call{Call: _e.mock.On("Stat", ctx, path)}
}
func (_c *Storage_Stat_Call) Run(run func(ctx context.Context, path string)) *Storage_Stat_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *Storage_Stat_Call) Return(_a0 *providerv1beta1.ResourceInfo, _a1 error) *Storage_Stat_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Storage_Stat_Call) RunAndReturn(run func(context.Context, string) (*providerv1beta1.ResourceInfo, error)) *Storage_Stat_Call {
_c.Call.Return(run)
return _c
}
// Upload provides a mock function with given fields: ctx, req
func (_m *Storage) Upload(ctx context.Context, req metadata.UploadRequest) (*metadata.UploadResponse, error) {
ret := _m.Called(ctx, req)
if len(ret) == 0 {
panic("no return value specified for Upload")
}
var r0 *metadata.UploadResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) (*metadata.UploadResponse, error)); ok {
return rf(ctx, req)
}
if rf, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) *metadata.UploadResponse); ok {
r0 = rf(ctx, req)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*metadata.UploadResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, metadata.UploadRequest) error); ok {
r1 = rf(ctx, req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_Upload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upload'
type Storage_Upload_Call struct {
*mock.Call
}
// Upload is a helper method to define mock.On call
// - ctx context.Context
// - req metadata.UploadRequest
func (_e *Storage_Expecter) Upload(ctx interface{}, req interface{}) *Storage_Upload_Call {
return &Storage_Upload_Call{Call: _e.mock.On("Upload", ctx, req)}
}
func (_c *Storage_Upload_Call) Run(run func(ctx context.Context, req metadata.UploadRequest)) *Storage_Upload_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(metadata.UploadRequest))
})
return _c
}
func (_c *Storage_Upload_Call) Return(_a0 *metadata.UploadResponse, _a1 error) *Storage_Upload_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Storage_Upload_Call) RunAndReturn(run func(context.Context, metadata.UploadRequest) (*metadata.UploadResponse, error)) *Storage_Upload_Call {
_c.Call.Return(run)
return _c
}
// NewStorage creates a new instance of Storage. 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 NewStorage(t interface {
mock.TestingT
Cleanup(func())
}) *Storage {
mock := &Storage{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}