Documentation ¶
Index ¶
- Variables
- type Manifest
- type Method
- type Scenario
- type Server
- type Test
- func (t Test) CheckCode(code int) error
- func (t Test) CheckContent(body string) error
- func (t Test) ContentType() string
- func (t Test) DoRequest() (code int, body string, err error)
- func (t Test) MethodName() string
- func (t Test) NewError(message string) error
- func (t Test) String() string
- func (t Test) Test() (err error)
- func (t Test) Validate() error
- type Tester
- type Tests
Constants ¶
This section is empty.
Variables ¶
View Source
var RequestTimeout uint = 5 // Timeout for each HTTP request (seconds)
View Source
var ServerTimeout uint = 120 // Timeout for a server's tests (seconds)
View Source
var Verbose = false // If true, every request is printed to standard output
Functions ¶
This section is empty.
Types ¶
type Manifest ¶
type Manifest []Server
Manifest contains one or more Servers, each having some Scenarios.
func (*Manifest) SetBaseURL ¶
SetBaseURL walks through all tests and prefixes any relative URLs (e.g. '/') with a base URL.
type Scenario ¶
A Scenario describes multiple tests executed in-order. Cookies are preserved within a scenario, so tests can depend on earlier tests.
type Test ¶
type Test struct { Url string // A fully specified URL including the protocol Content string ",omitempty" // Expected content as a regexp, e.g. "Hello World" Code int ",omitempty" // Expected HTTP response code Method string ",omitempty" // HTTP method, i.e. "GET" (default) or "POST" Type string ",omitempty" // Optional value for Content-Type header Data string ",omitempty" // Optional post data Headers map[string]string ",omitempty" // Optional headers to add to the request }
A single HTTP action, with the expected results.
func (Test) CheckContent ¶
CheckContent inspects the returned HTTP response body
func (Test) ContentType ¶
func (Test) MethodName ¶
Click to show internal directories.
Click to hide internal directories.