Documentation ¶
Index ¶
Constants ¶
View Source
const ( UserAgent = "mks-go/user-agent" TokenID = "test-token" )
Variables ¶
This section is empty.
Functions ¶
func HandleReqWithBody ¶
func HandleReqWithBody(t *testing.T, opts *HandleReqOpts)
HandleReqWithBody provides the HTTP endpoint to test requests with body.
func HandleReqWithoutBody ¶
func HandleReqWithoutBody(t *testing.T, opts *HandleReqOpts)
HandleReqWithoutBody provides the HTTP endpoint to test requests without body.
Types ¶
type HandleReqOpts ¶
type HandleReqOpts struct { // Mux represents HTTP Mux for a testing handler. Mux *http.ServeMux // URL represents handler's HTTP URL. URL string // RawResponse represents raw string HTTP response that needs to be returned // by the handler. RawResponse string // RawRequest represents raw string HTTP request that needs to be compared // with the actual request that will be provided by the caller. RawRequest string // Method contains HTTP method that needs to be compared against real method // provided by the caller. Method string // Status represents HTTP status that will be returned by the handler. Status int // CallFlag can be used to check if caller sent a request to a handler. CallFlag *bool }
HandleReqOpts represents options for the testing utils package handlers.
type TestEnv ¶
TestEnv represents a testing environment for all resources.
func (*TestEnv) TearDownTestEnv ¶
func (testEnv *TestEnv) TearDownTestEnv()
TearDownTestEnv releases the testing environment.
Click to show internal directories.
Click to hide internal directories.