mocks

package
v6.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	mock.Mock
}

File is an autogenerated mock type for the File type

func NewFile added in v6.4.0

func NewFile(t NewFileT) *File

NewFile creates a new instance of File. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*File) Close

func (_m *File) Close() error

Close provides a mock function with given fields:

func (*File) CopyToFile

func (_m *File) CopyToFile(file vfs.File) error

CopyToFile provides a mock function with given fields: file

func (*File) CopyToLocation

func (_m *File) CopyToLocation(location vfs.Location) (vfs.File, error)

CopyToLocation provides a mock function with given fields: location

func (*File) Delete

func (_m *File) Delete(deleteOpts ...options.DeleteOption) error

Delete provides a mock function with given fields: deleteOpts

func (*File) Exists

func (_m *File) Exists() (bool, error)

Exists provides a mock function with given fields:

func (*File) LastModified

func (_m *File) LastModified() (*time.Time, error)

LastModified provides a mock function with given fields:

func (*File) Location

func (_m *File) Location() vfs.Location

Location provides a mock function with given fields:

func (*File) MoveToFile

func (_m *File) MoveToFile(file vfs.File) error

MoveToFile provides a mock function with given fields: file

func (*File) MoveToLocation

func (_m *File) MoveToLocation(location vfs.Location) (vfs.File, error)

MoveToLocation provides a mock function with given fields: location

func (*File) Name

func (_m *File) Name() string

Name provides a mock function with given fields:

func (*File) Path

func (_m *File) Path() string

Path provides a mock function with given fields:

func (*File) Read

func (_m *File) Read(p []byte) (int, error)

Read provides a mock function with given fields: p

func (*File) Seek

func (_m *File) Seek(offset int64, whence int) (int64, error)

Seek provides a mock function with given fields: offset, whence

func (*File) Size

func (_m *File) Size() (uint64, error)

Size provides a mock function with given fields:

func (*File) String

func (_m *File) String() string

String provides a mock function with given fields:

func (*File) Touch

func (_m *File) Touch() error

Touch provides a mock function with given fields:

func (*File) URI

func (_m *File) URI() string

URI provides a mock function with given fields:

func (*File) Write

func (_m *File) Write(p []byte) (int, error)

Write provides a mock function with given fields: p

type FileSystem

type FileSystem struct {
	mock.Mock
}

FileSystem is an autogenerated mock type for the FileSystem type

func (*FileSystem) Name

func (_m *FileSystem) Name() string

Name provides a mock function with given fields:

func (*FileSystem) NewFile

func (_m *FileSystem) NewFile(volume string, absFilePath string) (vfs.File, error)

NewFile provides a mock function with given fields: volume, absFilePath

func (*FileSystem) NewLocation

func (_m *FileSystem) NewLocation(volume string, absLocPath string) (vfs.Location, error)

NewLocation provides a mock function with given fields: volume, absLocPath

func (*FileSystem) Retry

func (_m *FileSystem) Retry() vfs.Retry

Retry provides a mock function with given fields:

func (*FileSystem) Scheme

func (_m *FileSystem) Scheme() string

Scheme provides a mock function with given fields:

type Location

type Location struct {
	mock.Mock
}

Location is an autogenerated mock type for the Location type

func NewLocation added in v6.4.0

func NewLocation(t NewLocationT) *Location

NewLocation creates a new instance of Location. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*Location) ChangeDir

func (_m *Location) ChangeDir(relLocPath string) error

ChangeDir provides a mock function with given fields: relLocPath

func (*Location) DeleteFile

func (_m *Location) DeleteFile(relFilePath string, deleteOpts ...options.DeleteOption) error

DeleteFile provides a mock function with given fields: relFilePath, deleteOpts

func (*Location) Exists

func (_m *Location) Exists() (bool, error)

Exists provides a mock function with given fields:

func (*Location) FileSystem

func (_m *Location) FileSystem() vfs.FileSystem

FileSystem provides a mock function with given fields:

func (*Location) List

func (_m *Location) List() ([]string, error)

List provides a mock function with given fields:

func (*Location) ListByPrefix

func (_m *Location) ListByPrefix(prefix string) ([]string, error)

ListByPrefix provides a mock function with given fields: prefix

func (*Location) ListByRegex

func (_m *Location) ListByRegex(regex *regexp.Regexp) ([]string, error)

ListByRegex provides a mock function with given fields: regex

func (*Location) NewFile

func (_m *Location) NewFile(relFilePath string) (vfs.File, error)

NewFile provides a mock function with given fields: relFilePath

func (*Location) NewLocation

func (_m *Location) NewLocation(relLocPath string) (vfs.Location, error)

NewLocation provides a mock function with given fields: relLocPath

func (*Location) Path

func (_m *Location) Path() string

Path provides a mock function with given fields:

func (*Location) String

func (_m *Location) String() string

String provides a mock function with given fields:

func (*Location) URI

func (_m *Location) URI() string

URI provides a mock function with given fields:

func (*Location) Volume

func (_m *Location) Volume() string

Volume provides a mock function with given fields:

type NewFileT added in v6.4.0

type NewFileT interface {
	mock.TestingT
	Cleanup(func())
}

type NewLocationT added in v6.4.0

type NewLocationT interface {
	mock.TestingT
	Cleanup(func())
}

type ReadWriteFile

type ReadWriteFile struct {
	File
	Reader        io.Reader
	Writer        io.Writer
	Buffer        *bytes.Buffer
	ReaderContent string
}

ReadWriteFile is a custom mock which allows the consumer to assign a custom reader and writer for easily mocking file contents.

func NewMockFromFilepath

func NewMockFromFilepath(filePath string) *ReadWriteFile

NewMockFromFilepath creates a new ReadWriteFile instance that can read a file from the provided path.

func NewStringFile

func NewStringFile(data, fileName string) *ReadWriteFile

NewStringFile creates a new ReadWriteFile instance that can be read from the provided string as it's contents.

func (*ReadWriteFile) Content

func (f *ReadWriteFile) Content() string

Content returns the data held by the ReadWriteFile struct

func (*ReadWriteFile) Read

func (f *ReadWriteFile) Read(p []byte) (n int, err error)

Read statisfieds io.Reader interface

func (*ReadWriteFile) Write

func (f *ReadWriteFile) Write(p []byte) (n int, err error)

Write statisfieds io.Writer interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL