helpers

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestEnv

type TestEnv struct {
	Root        string
	Fs          storage.FS
	Tree        *tree.Tree
	Permissions *mocks.PermissionsChecker
	Blobstore   *treemocks.Blobstore
	Owner       *userpb.User
	Lookup      *decomposedfs.Lookup
	Ctx         context.Context
}

TestEnv represents a test environment for unit tests.

func NewTestEnv

func NewTestEnv() (*TestEnv, error)

NewTestEnv prepares a test environment on disk The storage contains some directories and a file:

/dir1/
/dir1/file1
/dir1/subdir1/

func (*TestEnv) Cleanup

func (t *TestEnv) Cleanup()

Cleanup removes all files from disk.

func (*TestEnv) CreateTestDir

func (t *TestEnv) CreateTestDir(name string) (*node.Node, error)

CreateTestDir create a directory and returns a corresponding Node.

func (*TestEnv) CreateTestFile

func (t *TestEnv) CreateTestFile(name, blobID string, blobSize int64, parentID string) (*node.Node, error)

CreateTestFile creates a new file and its metadata and returns a corresponding Node.

Jump to

Keyboard shortcuts

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