goamz: github.com/viru/goamz/testutil Index | Files

package testutil

import "github.com/viru/goamz/testutil"

Index

Package Files

http.go suite.go

Variables

var Amazon bool

Amazon must be used by all tested packages to determine whether to run functional tests against the real AWS servers.

type HTTPServer Uses

type HTTPServer struct {
    URL     string
    Timeout time.Duration
    // contains filtered or unexported fields
}

func NewHTTPServer Uses

func NewHTTPServer() *HTTPServer

func (*HTTPServer) Flush Uses

func (s *HTTPServer) Flush()

Flush discards all pending requests and responses.

func (*HTTPServer) Response Uses

func (s *HTTPServer) Response(status int, headers map[string]string, body string)

Response prepares the test server to respond the following request using the provided response parameters.

func (*HTTPServer) ResponseFunc Uses

func (s *HTTPServer) ResponseFunc(n int, f ResponseFunc)

ResponseFunc prepares the test server to respond the following n requests using f to build each response.

func (*HTTPServer) ResponseMap Uses

func (s *HTTPServer) ResponseMap(n int, m ResponseMap)

ResponseMap prepares the test server to respond the following n requests using the m to obtain the responses.

func (*HTTPServer) Responses Uses

func (s *HTTPServer) Responses(n int, status int, headers map[string]string, body string)

Responses prepares the test server to respond the following n requests using the provided response parameters.

func (*HTTPServer) ServeHTTP Uses

func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*HTTPServer) Start Uses

func (s *HTTPServer) Start()

func (*HTTPServer) WaitRequest Uses

func (s *HTTPServer) WaitRequest() *http.Request

WaitRequest returns the next request made to the http server from the queue. If no requests were previously made, it waits until the timeout value for one to be made.

func (*HTTPServer) WaitRequests Uses

func (s *HTTPServer) WaitRequests(n int) []*http.Request

WaitRequests returns the next n requests made to the http server from the queue. If not enough requests were previously made, it waits until the timeout value for them to be made.

type LiveSuite Uses

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

func (*LiveSuite) SetUpSuite Uses

func (s *LiveSuite) SetUpSuite(c *gocheck.C)

type Response Uses

type Response struct {
    Status  int
    Headers map[string]string
    Body    string
}

type ResponseFunc Uses

type ResponseFunc func(path string) Response

type ResponseMap Uses

type ResponseMap map[string]Response

ResponseMap maps request paths to responses.

Package testutil imports 11 packages (graph). Updated 2017-12-18. Refresh now. Tools for package owners.