testtools

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsJpeg

func IsJpeg(path string) bool

IsJpeg is a simple test tool to read in the specified file to see if it is a jpeg photo. This is intended to give us good enough confidence that the photo at that path had symlinking setup correctly by photofs. As long as we can read it as a valid jpeg then the symlinking worked. (we are also verifying the link target, this is just one added layer to make sure we can actually read the photo too.)

func MountPoint

func MountPoint() (string, func(), error)

func MountTestFs added in v0.2.0

func MountTestFs(mountPoint string, root fs.InodeEmbedder) (*fuse.Server, error)

func ToGoldFileFormat added in v0.2.0

func ToGoldFileFormat(treeInfo []FileInfo, mountPoint string, libraryRoot string)

ToGoldFileFormat does some processing of the "Walk" results so it may be stored as a "gold" file test result file

func VerifyJpegAreValid added in v0.2.0

func VerifyJpegAreValid(t TestingT, fileInfos []FileInfo)

VerifyJpegAreValid verifies that all of the JPEG files in the provided file infos are valid JPEG files.

Types

type FileInfo

type FileInfo struct {
	Path       string      `json:"path"`
	Mode       fs.FileMode `json:"mode"`
	LinkTarget string      `json:"linkTarget,omitempty"`
}

func GetOrUpdateGoldFile added in v0.2.0

func GetOrUpdateGoldFile(path string, act []FileInfo, update bool) []FileInfo

GetOrUpdateGoldFile gets an existing gold file or takes the actual file info and uses it to overwrite the existing gold file.

func MakeDirInfo added in v0.2.0

func MakeDirInfo(parts ...string) FileInfo

func MakeSymlinkInfo added in v0.2.0

func MakeSymlinkInfo(path []string, target string) FileInfo

func Walk

func Walk(walkPath string) ([]FileInfo, error)

type TestingT added in v0.2.0

type TestingT interface {
	Errorf(format string, args ...interface{})
}

TestingT is an interface wrapper around *testing.T

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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