mocks

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffListFilesOpts

func DiffListFilesOpts(want files.ListFilesOptions, got ...files.ListFileOption) (diff string)

Types

type MockFileManager

type MockFileManager struct {
	CreateFileFunc  func(ctx context.Context, fs afero.Fs, path, content string) (*model.File, error)
	ReadFileFunc    func(ctx context.Context, fs afero.Fs, path string) (*model.File, error)
	UpdateFileFunc  func(ctx context.Context, fs afero.Fs, path, content string) (*model.File, error)
	DeleteFileFunc  func(ctx context.Context, fs afero.Fs, path string) error
	ListFilesFunc   func(ctx context.Context, fs afero.Fs) ([]*model.File, error)
	ApplyPatchFunc  func(ctx context.Context, fs afero.Fs, path, patch string) (*model.File, error)
	UpdateLinesFunc func(ctx context.Context, fs afero.Fs, path string, lineDiff files.LineDiffChunk) (*model.File, error)
}

MockFileManager is a mock of the filemanager.FileManager interface for testing

func (*MockFileManager) ApplyPatch

func (m *MockFileManager) ApplyPatch(ctx context.Context, fs afero.Fs, path, patch string) (*model.File, error)

func (*MockFileManager) CreateFile

func (m *MockFileManager) CreateFile(ctx context.Context, fs afero.Fs, path, content string) (*model.File, error)

func (*MockFileManager) DeleteFile

func (m *MockFileManager) DeleteFile(ctx context.Context, fs afero.Fs, path string) error

func (*MockFileManager) ListFiles

func (m *MockFileManager) ListFiles(ctx context.Context, fs afero.Fs) ([]*model.File, error)

func (*MockFileManager) ReadFile

func (m *MockFileManager) ReadFile(ctx context.Context, fs afero.Fs, path string) (*model.File, error)

func (*MockFileManager) UpdateFile

func (m *MockFileManager) UpdateFile(ctx context.Context, fs afero.Fs, path, content string) (*model.File, error)

func (*MockFileManager) UpdateLines

func (m *MockFileManager) UpdateLines(ctx context.Context, fs afero.Fs, path string, lineDiff files.LineDiffChunk) (*model.File, error)

Jump to

Keyboard shortcuts

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