storagetesting

package
v0.0.0-...-26f4575 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package storagetesting implements testing utilities and integration tests for storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNotExist

func AssertNotExist(
	t *testing.T,
	readBucket storage.ReadBucket,
	path string,
)

AssertNotExist asserts the path has the expected ObjectInfo.

func AssertObjectInfo

func AssertObjectInfo(
	t *testing.T,
	readBucket storage.ReadBucket,
	path string,
	externalPath string,
)

AssertObjectInfo asserts the path has the expected ObjectInfo.

func AssertObjectInfoEqual

func AssertObjectInfoEqual(
	t *testing.T,
	expected storage.ObjectInfo,
	actual storage.ObjectInfo,
)

AssertObjectInfoEqual asserts the two ObjectInfos are equal.

func AssertPathToContent

func AssertPathToContent(
	t *testing.T,
	readBucket storage.ReadBucket,
	walkPrefix string,
	expectedPathToContent map[string]string,
)

AssertPathToContent asserts the content.

func AssertPaths

func AssertPaths(
	t *testing.T,
	readBucket storage.ReadBucket,
	walkPrefix string,
	expectedPaths ...string,
)

AssertPaths asserts the paths.

func RunTestSuite

func RunTestSuite(
	t *testing.T,
	storagetestingDirPath string,
	newReadBucket func(*testing.T, string, storageos.Provider) (storage.ReadBucket, GetExternalPathFunc),
	newWriteBucket func(*testing.T, storageos.Provider) storage.WriteBucket,
	writeBucketToReadBucket func(*testing.T, storage.WriteBucket) storage.ReadBucket,
)

RunTestSuite runs the test suite.

storagetestingDirPath is the path to this directory. newReadBucket takes a path to a directory.

Types

type GetExternalPathFunc

type GetExternalPathFunc func(*testing.T, string, string) string

GetExternalPathFunc can be used to get the external path of a path given the root path.

Jump to

Keyboard shortcuts

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