Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoRequest ¶
func DoRequest(t *testing.T, httpHandler *HTTPHandler)
DoRequest helps test that whether the http response with the given method,url,requestJSON,handlerFunc matches with the expectHTTPCode and expectResponse. if false the test will be not failed
Types ¶
type EtcdCluster ¶
type EtcdCluster struct { Endpoints []string // contains filtered or unexported fields }
EtcdCluster mock etcd cluster for testing
func StartEtcdCluster ¶
func StartEtcdCluster(t *testing.T) *EtcdCluster
StartEtcdCluster starts integration etcd cluster
func (*EtcdCluster) Terminate ¶
func (etcd *EtcdCluster) Terminate(t *testing.T)
Terminate terminates integration etcd cluster
type HTTPHandler ¶
type HTTPHandler struct { Method string URL string RequestBody interface{} HandlerFunc http.HandlerFunc ExpectHTTPCode int ExpectResponse interface{} }
HTTPHandler represents amock http handler
type RepoTestSuite ¶
type RepoTestSuite struct {
Cluster *EtcdCluster
}
RepoTestSuite represents repo test suite init integration etcd cluster
func (*RepoTestSuite) SetUpSuite ¶
func (ts *RepoTestSuite) SetUpSuite(c *check.C)
SetUpSuite setups test suite
func (*RepoTestSuite) TearDownSuite ¶
func (ts *RepoTestSuite) TearDownSuite(c *check.C)
TearDownSuite teardowns test suite, release resource
Click to show internal directories.
Click to hide internal directories.