testutil

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllFileTestCases

func AllFileTestCases() (out []artifact.Status)

AllFileTestCases returns a slice of all valid artifact.Status structs. (See status.txt in the project root)

Types

type MockFileInfo

type MockFileInfo struct {
	MockName    string
	MockSize    int64
	MockMode    os.FileMode
	MockModTime time.Time
}

MockFileInfo mocks os.FileInfo

func (MockFileInfo) IsDir

func (m MockFileInfo) IsDir() bool

IsDir returns true if the file is a directory, false otherwise

func (MockFileInfo) ModTime

func (m MockFileInfo) ModTime() time.Time

ModTime returns the modification time of the file

func (MockFileInfo) Mode

func (m MockFileInfo) Mode() os.FileMode

Mode returns the os.FileMode of the file

func (MockFileInfo) Name

func (m MockFileInfo) Name() string

Name returns the basename of the file

func (MockFileInfo) Size

func (m MockFileInfo) Size() int64

Size return the size of the file

func (MockFileInfo) Sys

func (m MockFileInfo) Sys() interface{}

Sys only exists to satisfy the FileInfo interface; it always returns nil

type TempDirs

type TempDirs struct {
	CacheDir string
	WorkDir  string
}

TempDirs holds a pair of cache and workspace directory paths for integration testing.

func CreateArtifactTestCase

func CreateArtifactTestCase(status artifact.Status) (dirs TempDirs, art artifact.Artifact, err error)

CreateArtifactTestCase sets up an integration test environment with a single artifact that complies with the provided artifact.Status.

func CreateTempDirs

func CreateTempDirs() (dirs TempDirs, err error)

CreateTempDirs creates a Dud cache and workspace in the OS temp FS.

Jump to

Keyboard shortcuts

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