Documentation ¶
Index ¶
- Variables
- func AssertStatus(t *testing.T, status int, method, url string, values url.Values, ...) string
- func CreateAppStackCycle(appName string) awsutil.Cycle
- func CreateAppStackExistsCycle(appName string) awsutil.Cycle
- func DeleteStackCycle(stackName string) awsutil.Cycle
- func DescribeAppStackCycle(stackName string) awsutil.Cycle
- func DescribeConvoxStackCycle(stackName string) awsutil.Cycle
- func DescribeStackCycleWithoutQuery(appName string) awsutil.Cycle
- func DescribeStackNotFound(stackName string) awsutil.Cycle
- func GetAppTemplateCycle(stackName string) awsutil.Cycle
- func HTTPBody(method, url string, values url.Values, headers map[string]string) string
- func InspectCycle(id string) awsutil.Cycle
- func ListECSContainersCycle() awsutil.Cycle
- func ListECSOneoffContainersCycle() awsutil.Cycle
- func ListOneoffContainersCycle(id string) awsutil.Cycle
- func ListOneoffContainersEmptyCycle() awsutil.Cycle
- func Runs(t *testing.T, runs ...Run)
- func Server(t *testing.T, stubs ...Http) *httptest.Server
- func StatsCycle() awsutil.Cycle
- func StubAws(cycles ...awsutil.Cycle) (s *httptest.Server)
- func StubDocker(cycles ...awsutil.Cycle) (s *httptest.Server)
- type ErrorNotFound
- type ExecRun
- type HandlerFuncTest
- func (f *HandlerFuncTest) AssertCode(t *testing.T, code int)
- func (f *HandlerFuncTest) AssertError(t *testing.T, message string)
- func (f *HandlerFuncTest) AssertJSON(t *testing.T, body string)
- func (f *HandlerFuncTest) AssertSuccess(t *testing.T)
- func (f *HandlerFuncTest) Body() []byte
- func (f *HandlerFuncTest) Code() int
- func (f *HandlerFuncTest) Request(method, url string, values url.Values) error
- func (f *HandlerFuncTest) SetVersion(version string)
- type Http
- type Run
Constants ¶
This section is empty.
Variables ¶
var HandlerFunc http.HandlerFunc
Functions ¶
func AssertStatus ¶
func AssertStatus(t *testing.T, status int, method, url string, values url.Values, headers map[string]string) string
AssertStatus fails a test if the response status doesn't match the expected status
func CreateAppStackCycle ¶
func DeleteStackCycle ¶
func DescribeAppStackCycle ¶
returns the stack you asked for
func DescribeConvoxStackCycle ¶
returns convox stack
func DescribeStackCycleWithoutQuery ¶
no filter - returns convox stack and an app
func DescribeStackNotFound ¶
search for stack, return missing
func GetAppTemplateCycle ¶
func InspectCycle ¶
func ListECSContainersCycle ¶
func StatsCycle ¶
func StubDocker ¶
Create a test server that mocks an Docker request/response cycle, suitable for a single test
Example:
s := StubDocker(ListContainersCycle()) defer s.Close() d, _ := Docker(test.TestConfig.DockerHost) d.ListContainers(...)
Types ¶
type ErrorNotFound ¶
type ErrorNotFound string
ErrorNotFound means the requested item was not found
func (ErrorNotFound) Error ¶
func (e ErrorNotFound) Error() string
Error satisfies the error interface
func (ErrorNotFound) NotFound ¶
func (e ErrorNotFound) NotFound() bool
NotFound defines the behavior of this error
type ExecRun ¶
type HandlerFuncTest ¶
type HandlerFuncTest struct { Handler http.HandlerFunc // contains filtered or unexported fields }
HandlerFuncTest is a helper for running tests on http.HandlerFunc
func NewHandlerFunc ¶
func NewHandlerFunc(handler http.HandlerFunc) HandlerFuncTest
NewHandlerFunc returns a new HandlerFuncTest
func (*HandlerFuncTest) AssertCode ¶
func (f *HandlerFuncTest) AssertCode(t *testing.T, code int)
AssertCode asserts the response code
func (*HandlerFuncTest) AssertError ¶
func (f *HandlerFuncTest) AssertError(t *testing.T, message string)
AssertError asserts a response error
func (*HandlerFuncTest) AssertJSON ¶
func (f *HandlerFuncTest) AssertJSON(t *testing.T, body string)
AssertJSON assets a JSON response (ignoring whitespace differences)
func (*HandlerFuncTest) AssertSuccess ¶
func (f *HandlerFuncTest) AssertSuccess(t *testing.T)
AssertSuccess asserts a successful response
func (*HandlerFuncTest) Body ¶
func (f *HandlerFuncTest) Body() []byte
Body returns the response body
func (*HandlerFuncTest) Request ¶
func (f *HandlerFuncTest) Request(method, url string, values url.Values) error
Request executes an HTTP request against the tester
func (*HandlerFuncTest) SetVersion ¶
func (f *HandlerFuncTest) SetVersion(version string)
SetVersion sets the Version: HTTP header