filetesting

package
v0.0.0-...-d0fb1a3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2014 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir struct {
	Path string
	Perm os.FileMode
}

Dir is an Entry that allows directories to be created and verified. The Path field should use "/" as the path separator.

func (Dir) Check

func (d Dir) Check(c *gc.C, basePath string) Entry

func (Dir) Create

func (d Dir) Create(c *gc.C, basePath string) Entry

func (Dir) GetPath

func (d Dir) GetPath() string

type Entries

type Entries []Entry

Entries supplies convenience methods on Entry slices.

func (Entries) AsRemoveds

func (e Entries) AsRemoveds() Entries

AsRemoveds returns a slice of Removed entries whose paths correspond to those in e.

func (Entries) Check

func (e Entries) Check(c *gc.C, basePath string) Entries

Check checks every entry relative to basePath and returns a copy of itself.

func (Entries) Create

func (e Entries) Create(c *gc.C, basePath string) Entries

Create creates every entry relative to basePath and returns a copy of itself.

func (Entries) Paths

func (e Entries) Paths() []string

Paths returns the slash-separated path of every entry.

type Entry

type Entry interface {

	// GetPath returns the slash-separated relative path that this
	// entry represents.
	GetPath() string

	// Create causes the entry to be created, relative to basePath. It returns
	// a copy of the receiver.
	Create(c *gc.C, basePath string) Entry

	// Check checks that the entry exists, relative to basePath, and matches
	// the entry that would be created by Create. It returns a copy of the
	// receiver.
	Check(c *gc.C, basePath string) Entry
}

Entry represents a filesystem entity that can be created; and whose correctness can be verified.

type File

type File struct {
	Path string
	Data string
	Perm os.FileMode
}

File is an Entry that allows plain files to be created and verified. The Path field should use "/" as the path separator.

func (File) Check

func (f File) Check(c *gc.C, basePath string) Entry

func (File) Create

func (f File) Create(c *gc.C, basePath string) Entry

func (File) GetPath

func (f File) GetPath() string

type Removed

type Removed struct {
	Path string
}

Removed is an Entry that indicates the absence of any entry. The Path field should use "/" as the path separator.

func (Removed) Check

func (r Removed) Check(c *gc.C, basePath string) Entry

func (Removed) Create

func (r Removed) Create(c *gc.C, basePath string) Entry

func (Removed) GetPath

func (r Removed) GetPath() string
type Symlink struct {
	Path string
	Link string
}

Symlink is an Entry that allows symlinks to be created and verified. The Path field should use "/" as the path separator.

func (Symlink) Check

func (s Symlink) Check(c *gc.C, basePath string) Entry

func (Symlink) Create

func (s Symlink) Create(c *gc.C, basePath string) Entry

func (Symlink) GetPath

func (s Symlink) GetPath() string

Jump to

Keyboard shortcuts

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