helpers

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OwnerID = "25b69780-5f39-43be-a7ac-a9b9e9fe4230"
	User0ID = "824385ae-8fc6-4896-8eb2-d1d171290bd0"
	User1ID = "693b0d96-80a2-4016-b53d-425ce4f66114"
)

Constant UUIDs for the space users

Variables

This section is empty.

Functions

This section is empty.

Types

type TestEnv

type TestEnv struct {
	Root              string
	Fs                *decomposedfs.Decomposedfs
	Tree              *tree.Tree
	Permissions       *mocks.PermissionsChecker
	Blobstore         *treemocks.Blobstore
	Owner             *userpb.User
	Users             []*userpb.User
	Lookup            *lookup.Lookup
	Ctx               context.Context
	SpaceRootRes      *providerv1beta1.ResourceId
	PermissionsClient *mocks.CS3PermissionsClient
}

TestEnv represents a test environment for unit tests

func NewTestEnv

func NewTestEnv(config map[string]interface{}) (*TestEnv, error)

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

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

The default config can be overridden by providing the strings to override via map as a parameter

func (*TestEnv) Cleanup

func (t *TestEnv) Cleanup()

Cleanup removes all files from disk

func (*TestEnv) CreateTestDir

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

CreateTestDir create a directory and returns a corresponding Node

func (*TestEnv) CreateTestFile

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

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

func (*TestEnv) CreateTestStorageSpace

func (t *TestEnv) CreateTestStorageSpace(typ string, quota *providerv1beta1.Quota) (*providerv1beta1.ResourceId, error)

CreateTestStorageSpace will create a storage space with some directories and files It returns the ResourceId of the space

/dir1/ /dir1/file1 /dir1/subdir1

Jump to

Keyboard shortcuts

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