test

package
v0.3.0-8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRunContext

func NewRunContext() check.RunContext

NewRunContext returns a test run context pre-configured with an in-memory output data store.

Types

type FileInfo

type FileInfo struct {
	// contains filtered or unexported fields
}

FileInfo is a mock implementation of the os.FileInfo interface for unit testing purposes.

func (*FileInfo) IsDir

func (info *FileInfo) IsDir() bool

IsDir reports the mock directory value

func (*FileInfo) ModTime

func (info *FileInfo) ModTime() time.Time

ModTime returns the mock modification time

func (*FileInfo) Mode

func (info *FileInfo) Mode() os.FileMode

Mode returns the mock node

func (*FileInfo) Name

func (info *FileInfo) Name() string

Name returns the mock name

func (*FileInfo) Size

func (info *FileInfo) Size() int64

Size returns the mock size

func (*FileInfo) Sys

func (info *FileInfo) Sys() interface{}

Sys returns the mock sys

type OutputStore

type OutputStore struct {
	// contains filtered or unexported fields
}

OutputStore is a mock implementation of the output.Store interface for unit testing purposes.

func NewOutputStore

func NewOutputStore() *OutputStore

NewOutputStore returns a new mock (in-memory) output store. The intended use for this is in unit testing.

func (*OutputStore) Cleanup

func (store *OutputStore) Cleanup() error

Cleanup removes the directory and files used for this output store

func (*OutputStore) Items

func (store *OutputStore) Items() ([]output.StoreItem, error)

Items returns the collection of outputs store in this directory

func (*OutputStore) Save

func (store *OutputStore) Save(name string, reader io.Reader) error

Save stores a given output to the directory as a file

type OutputStoreItem

type OutputStoreItem struct {
	// contains filtered or unexported fields
}

OutputStoreItem is a mock implementation of the output.StoreItem interface for unit testing purposes.

func (*OutputStoreItem) Info

func (item *OutputStoreItem) Info() (os.FileInfo, error)

Info returns the stat results for a given item (file) in a DirectoryStore

func (*OutputStoreItem) Open

func (item *OutputStoreItem) Open() (io.Reader, func() error, error)

Open returns the io.Reader to the file for the DirectoryStoreItem

Jump to

Keyboard shortcuts

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