Documentation ¶
Index ¶
- Constants
- 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 ¶
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 ¶
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.