Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServerTestBaseContext ¶
NewServerTestBaseContext creates a base context for testing. This uses embedded certs and the "node" user (default node user). The certs file loader is overriden in individual main_test files. This is meant to be used by nodes and node-clients (node-node requests).
func NewTestBaseContext ¶
NewTestBaseContext creates a base context for testing. This uses embedded certs and the "root" user (default client user). The certs file loader is overriden in individual main_test files. This is meant to be used by external clients (as opposed to nodes).
func NewTestHTTPClient ¶
NewTestHTTPClient creates a HTTP client on the fly using a test context. Useful when contexts don't need to be reused.
Types ¶
type TestHTTPSession ¶
type TestHTTPSession struct {
// contains filtered or unexported fields
}
TestHTTPSession is a helper for tests which want to exercise repeated simple HTTP requests against the same server, especially where no errors are expected in the HTTP layer.
func NewTestHTTPSession ¶
NewTestHTTPSession constructs a new TestHTTPSession. The session will instantiate a client using the based base context. All HTTP requests from the session will be sent to the given baseUrl.
baseUrl should be specified *without* a request scheme (i.e. "http://"); the request scheme will be used from the context.
If an error occurs in HTTP layer during any session operation, a Fatal method will be called on the supplied t.Tester.
func (*TestHTTPSession) Get ¶
func (ths *TestHTTPSession) Get(relative string) []byte
Get performs an http GET request to the given relative URL. Any response returned from the request will be returned from this method as a byte slice.