Back to godoc.org

Package storagetesting

v0.20.5
Latest Go to latest

The latest major version is .

Published: Jul 24, 2020 | License: Apache-2.0 | Module: github.com/bufbuild/buf

Overview

Package storagetesting implements testing utilities and integration tests for storage.

Index

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,
	size uint32,
	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 RunTestSuite

func RunTestSuite(
	t *testing.T,
	storagetestingDirPath string,
	newReadBucket func(*testing.T, string) storage.ReadBucket,
	newWriteBucketAndCleanup func(*testing.T) (storage.WriteBucket, func() error),
	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.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier