Documentation ¶
Index ¶
- type TestEnv
- func (t *TestEnv) Cleanup()
- func (t *TestEnv) CreateTestDir(name string, parentRef *providerv1beta1.Reference) (*node.Node, error)
- func (t *TestEnv) CreateTestFile(name, blobID, parentID, spaceID string, blobSize int64) (*node.Node, error)
- func (t *TestEnv) CreateTestStorageSpace(typ string, quota *providerv1beta1.Quota) (*providerv1beta1.ResourceId, error)
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 *lookup.Lookup Ctx context.Context SpaceRootRes *providerv1beta1.ResourceId PermissionsClient *mocks.CS3PermissionsClient }
TestEnv represents a test environment for unit tests
func NewTestEnv ¶
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) 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
Click to show internal directories.
Click to hide internal directories.