test

package
v0.6.3-0...-140fefd Latest Latest
Warning

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

Go to latest
Published: May 4, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package test is a test-only package that can be used by other cli package to write unit test.

It as an internal package and cannot be used outside of github.com/docker/docker/cli package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeStore

func NewFakeStore() credentials.Store

NewFakeStore creates a new file credentials store.

Types

type FakeCli

type FakeCli struct {
	command.DockerCli
	// contains filtered or unexported fields
}

FakeCli emulates the default DockerCli

func NewFakeCli

func NewFakeCli(client client.APIClient, out io.Writer) *FakeCli

NewFakeCli returns a Cli backed by the fakeCli

func (*FakeCli) Client

func (c *FakeCli) Client() client.APIClient

Client returns a docker API client

func (*FakeCli) ConfigFile

func (c *FakeCli) ConfigFile() *configfile.ConfigFile

ConfigFile returns the cli configfile object (to get client configuration)

func (*FakeCli) CredentialsStore

func (c *FakeCli) CredentialsStore(serverAddress string) credentials.Store

CredentialsStore returns the fake store the cli will use

func (*FakeCli) Err

func (c *FakeCli) Err() io.Writer

Err returns the output stream (stderr) the cli should write on

func (*FakeCli) In

func (c *FakeCli) In() *command.InStream

In returns the input stream the cli will use

func (*FakeCli) Out

func (c *FakeCli) Out() *command.OutStream

Out returns the output stream (stdout) the cli should write on

func (*FakeCli) SetConfigfile

func (c *FakeCli) SetConfigfile(configfile *configfile.ConfigFile)

SetConfigfile sets the "fake" config file

func (*FakeCli) SetErr

func (c *FakeCli) SetErr(err io.Writer)

SetErr sets the stderr stream for the cli to the specified io.Writer

func (*FakeCli) SetIn

func (c *FakeCli) SetIn(in *command.InStream)

SetIn sets the input of the cli to the specified ReadCloser

Directories

Path Synopsis
Package builders helps you create struct for your unit test while keeping them expressive.
Package builders helps you create struct for your unit test while keeping them expressive.

Jump to

Keyboard shortcuts

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