test

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeCallbackInvoker

type FakeCallbackInvoker struct {
	CallbackUrl string
	Success     bool
	Messages    []string
	Result      []string
}

func (*FakeCallbackInvoker) ExecuteCallback

func (f *FakeCallbackInvoker) ExecuteCallback(callbackUrl string, success bool, messages []string) []string

type FakeCmdRunner

type FakeCmdRunner struct {
	Name string
	Args []string
	Opts util.CommandOpts
	Err  error
}

func (*FakeCmdRunner) Run

func (f *FakeCmdRunner) Run(name string, args ...string) error

func (*FakeCmdRunner) RunWithOptions

func (f *FakeCmdRunner) RunWithOptions(opts util.CommandOpts, name string, args ...string) error

type FakeDocker

type FakeDocker struct {
	LocalRegistryImage           string
	LocalRegistryResult          bool
	LocalRegistryError           error
	RemoveContainerID            string
	RemoveContainerError         error
	DefaultUrlImage              string
	DefaultUrlResult             string
	DefaultUrlError              error
	RunContainerOpts             docker.RunContainerOptions
	RunContainerError            error
	RunContainerErrorBeforeStart bool
	RunContainerContainerID      string
	RunContainerCmd              []string
	GetImageIdImage              string
	GetImageIdResult             string
	GetImageIdError              error
	CommitContainerOpts          docker.CommitContainerOptions
	CommitContainerResult        string
	CommitContainerError         error
	RemoveImageName              string
	RemoveImageError             error
	// contains filtered or unexported fields
}

func (*FakeDocker) CommitContainer

func (f *FakeDocker) CommitContainer(opts docker.CommitContainerOptions) (string, error)

func (*FakeDocker) GetDefaultScriptsUrl

func (f *FakeDocker) GetDefaultScriptsUrl(image string) (string, error)

func (*FakeDocker) GetImageId

func (f *FakeDocker) GetImageId(image string) (string, error)

func (*FakeDocker) IsImageInLocalRegistry

func (f *FakeDocker) IsImageInLocalRegistry(imageName string) (bool, error)

func (*FakeDocker) RemoveContainer

func (f *FakeDocker) RemoveContainer(id string) error

func (*FakeDocker) RemoveImage

func (f *FakeDocker) RemoveImage(name string) error

func (*FakeDocker) RunContainer

func (f *FakeDocker) RunContainer(opts docker.RunContainerOptions) error

type FakeDownloader

type FakeDownloader struct {
	URL  []url.URL
	File []string
	Err  map[string]error
	// contains filtered or unexported fields
}

func (*FakeDownloader) DownloadFile

func (f *FakeDownloader) DownloadFile(url *url.URL, targetFile string) error

type FakeFileSystem

type FakeFileSystem struct {
	ChmodFile  []string
	ChmodMode  os.FileMode
	ChmodError map[string]error

	RenameFrom  string
	RenameTo    string
	RenameError error

	MkdirAllDir   []string
	MkdirAllError error

	MkdirDir   string
	MkdirError error

	ExistsFile   []string
	ExistsResult map[string]bool

	CopySource string
	CopyDest   string
	CopyError  error

	RemoveDirName  string
	RemoveDirError error

	WorkingDirCalled bool
	WorkingDirResult string
	WorkingDirError  error

	OpenFile       string
	OpenFileResult *FakeReadCloser
	OpenContent    string
	OpenError      error
	OpenCloseError error
	// contains filtered or unexported fields
}

func (*FakeFileSystem) Chmod

func (f *FakeFileSystem) Chmod(file string, mode os.FileMode) error

func (*FakeFileSystem) Copy

func (f *FakeFileSystem) Copy(sourcePath, targetPath string) error

func (*FakeFileSystem) CreateWorkingDirectory

func (f *FakeFileSystem) CreateWorkingDirectory() (string, error)

func (*FakeFileSystem) Exists

func (f *FakeFileSystem) Exists(file string) bool

func (*FakeFileSystem) Mkdir

func (f *FakeFileSystem) Mkdir(dirname string) error

func (*FakeFileSystem) MkdirAll

func (f *FakeFileSystem) MkdirAll(dirname string) error

func (*FakeFileSystem) Open

func (f *FakeFileSystem) Open(file string) (io.ReadCloser, error)

func (*FakeFileSystem) RemoveDirectory

func (f *FakeFileSystem) RemoveDirectory(dir string) error

func (*FakeFileSystem) Rename

func (f *FakeFileSystem) Rename(from, to string) error

type FakeGit

type FakeGit struct {
	ValidCloneSpecSource string
	ValidCloneSpecResult bool

	CloneSource string
	CloneTarget string
	CloneError  error

	CheckoutRepo  string
	CheckoutRef   string
	CheckoutError error
}

func (*FakeGit) Checkout

func (f *FakeGit) Checkout(repo, ref string) error

func (*FakeGit) Clone

func (f *FakeGit) Clone(source, target string) error

func (*FakeGit) ValidCloneSpec

func (f *FakeGit) ValidCloneSpec(source string) bool

type FakeInstaller

type FakeInstaller struct {
	Scripts    [][]string
	WorkingDir []string
	Required   []bool

	Err error
}

func (*FakeInstaller) DownloadAndInstall

func (f *FakeInstaller) DownloadAndInstall(scripts []string, workingDir string, required bool) error

type FakeReadCloser

type FakeReadCloser struct {
	*bytes.Buffer
	CloseCalled bool
	CloseError  error
}

func (*FakeReadCloser) Close

func (f *FakeReadCloser) Close() error

type FakeTar

type FakeTar struct {
	CreateTarBase   string
	CreateTarDir    string
	CreateTarResult string
	CreateTarError  error

	ExtractTarDir    string
	ExtractTarReader io.Reader
	ExtractTarError  error
}

func (*FakeTar) CreateTarFile

func (f *FakeTar) CreateTarFile(base, dir string) (string, error)

func (*FakeTar) ExtractTarStream

func (f *FakeTar) ExtractTarStream(dir string, reader io.Reader) error

Jump to

Keyboard shortcuts

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