Documentation ¶
Index ¶
- func MustInterfaceToString(v interface{}) string
- type Api
- func (this *Api) Cookie(name, value string) *Api
- func (this *Api) Delete(path string, params ...interface{}) *Api
- func (this *Api) Expect(t *testing.T) *ApiExpect
- func (this *Api) Form(key string, value interface{}) *Api
- func (this *Api) Get(path string, params ...interface{}) *Api
- func (this *Api) Header(name, value string) *Api
- func (this *Api) Json(json string) *Api
- func (this *Api) Param(key string, value interface{}) *Api
- func (this *Api) Post(path string, params ...interface{}) *Api
- func (this *Api) Put(path string, params ...interface{}) *Api
- type ApiExpect
- func (this *ApiExpect) Cookies(name string) *CookiesExpect
- func (this *ApiExpect) Fatalf(format string, args ...interface{})
- func (this *ApiExpect) Headers() *HeadersExpect
- func (this *ApiExpect) Json() *JsonExpect
- func (this *ApiExpect) Plain() *PlainExpect
- func (this *ApiExpect) Status() *StatusExpect
- type ApiRequest
- type CookiesExpect
- func (this *CookiesExpect) Domain(domain string) *CookiesExpect
- func (this *CookiesExpect) Expires(startAt, endAt time.Time) *CookiesExpect
- func (this *CookiesExpect) StoreValue(value *string) *CookiesExpect
- func (this *CookiesExpect) Test(test func(t *testing.T, cookies []*http.Cookie)) *CookiesExpect
- func (this *CookiesExpect) Value(value string) *CookiesExpect
- type Db
- type DbExpect
- func (this *DbExpect) Eq(field string, value interface{}) *DbExpect
- func (this *DbExpect) Fatalf(format string, args ...interface{})
- func (this *DbExpect) RowNumEq(num int) *DbExpect
- func (this *DbExpect) RowNumGe(num int) *DbExpect
- func (this *DbExpect) RowNumGt(num int) *DbExpect
- func (this *DbExpect) Test(test func(t *testing.T, rows []*DbRow)) *DbExpect
- type DbRequest
- type DbRow
- func (this *DbRow) GetFloat(f string) (float64, error)
- func (this *DbRow) GetInt(f string) (int64, error)
- func (this *DbRow) GetString(f string) (string, error)
- func (this *DbRow) MustGetFloat(f string) float64
- func (this *DbRow) MustGetInt(f string) int64
- func (this *DbRow) MustGetString(f string) string
- type HeadersExpect
- func (this *HeadersExpect) Eq(name, v string) *HeadersExpect
- func (this *HeadersExpect) EqAny(name string, vs ...string) *HeadersExpect
- func (this *HeadersExpect) Exist(name string) *HeadersExpect
- func (this *HeadersExpect) ExistAny(names ...string) *HeadersExpect
- func (this *HeadersExpect) NotExist(name string) *HeadersExpect
- type IniCnf
- type InterfaceMatchFunc
- type JsonExpect
- func (this *JsonExpect) Contains(jpath string, value interface{}) *JsonExpect
- func (this *JsonExpect) ContainsString(jpath string, value string) *JsonExpect
- func (this *JsonExpect) Eq(jpath string, value interface{}) *JsonExpect
- func (this *JsonExpect) EqAnyFloat(jpath string, values ...float64) *JsonExpect
- func (this *JsonExpect) EqAnyInt(jpath string, values ...int64) *JsonExpect
- func (this *JsonExpect) EqAnyString(jpath string, values ...string) *JsonExpect
- func (this *JsonExpect) FloatContains(jpath string, value float64) *JsonExpect
- func (this *JsonExpect) FloatOnlyContains(jpath string, value float64) *JsonExpect
- func (this *JsonExpect) Ge(jpath string, value int64) *JsonExpect
- func (this *JsonExpect) Gt(jpath string, value int64) *JsonExpect
- func (this *JsonExpect) IntContains(jpath string, value int64) *JsonExpect
- func (this *JsonExpect) IntOnlyContains(jpath string, value int64) *JsonExpect
- func (this *JsonExpect) IsNull(jpath string) *JsonExpect
- func (this *JsonExpect) Le(jpath string, value int64) *JsonExpect
- func (this *JsonExpect) Lt(jpath string, value int64) *JsonExpect
- func (this *JsonExpect) Match(jpath string, matchFunc InterfaceMatchFunc, value interface{}) *JsonExpect
- func (this *JsonExpect) MatchAnyString(jpath string, matchFunc StringMatchFunc, values ...string) *JsonExpect
- func (this *JsonExpect) MustJsonPahAsFloatArray(jpath string) []float64
- func (this *JsonExpect) MustJsonPahAsInt(jpath string) int64
- func (this *JsonExpect) MustJsonPahAsIntArray(jpath string) []int64
- func (this *JsonExpect) MustJsonPahAsStringArray(jpath string) []string
- func (this *JsonExpect) MustJsonPathLookup(jpath string) interface{}
- func (this *JsonExpect) NotNull(jpath string) *JsonExpect
- func (this *JsonExpect) OnlyContains(jpath string, value interface{}) *JsonExpect
- func (this *JsonExpect) StoreFloat(jpath string, ret *float64) *JsonExpect
- func (this *JsonExpect) StoreInt(jpath string, ret *int64) *JsonExpect
- func (this *JsonExpect) StoreString(jpath string, ret *string) *JsonExpect
- func (this *JsonExpect) StringContains(jpath string, value string) *JsonExpect
- func (this *JsonExpect) StringOnlyContains(jpath string, value string) *JsonExpect
- func (this *JsonExpect) Test(jpath string, test func(t *testing.T, v interface{})) *JsonExpect
- type PlainExpect
- type StatusExpect
- type StringMatchFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustInterfaceToString ¶
func MustInterfaceToString(v interface{}) string
Types ¶
type Api ¶
type Api struct { Endpoint string Timeout time.Duration Headers http.Header Cookies map[string]string Request *ApiRequest }
func NewHttpTest ¶
type ApiExpect ¶
type ApiExpect struct {
// contains filtered or unexported fields
}
func (*ApiExpect) Cookies ¶
func (this *ApiExpect) Cookies(name string) *CookiesExpect
func (*ApiExpect) Headers ¶
func (this *ApiExpect) Headers() *HeadersExpect
func (*ApiExpect) Json ¶
func (this *ApiExpect) Json() *JsonExpect
func (*ApiExpect) Plain ¶
func (this *ApiExpect) Plain() *PlainExpect
func (*ApiExpect) Status ¶
func (this *ApiExpect) Status() *StatusExpect
type ApiRequest ¶
type ApiRequest struct { Timeout time.Duration Method string Path string PathParams []string Params url.Values Headers http.Header Cookies map[string]string Forms url.Values Json string }
func NewApiRequest ¶
func NewApiRequest() *ApiRequest
type CookiesExpect ¶
type CookiesExpect struct { *ApiExpect // contains filtered or unexported fields }
func (*CookiesExpect) Domain ¶
func (this *CookiesExpect) Domain(domain string) *CookiesExpect
func (*CookiesExpect) Expires ¶
func (this *CookiesExpect) Expires(startAt, endAt time.Time) *CookiesExpect
func (*CookiesExpect) StoreValue ¶
func (this *CookiesExpect) StoreValue(value *string) *CookiesExpect
func (*CookiesExpect) Test ¶
func (this *CookiesExpect) Test(test func(t *testing.T, cookies []*http.Cookie)) *CookiesExpect
func (*CookiesExpect) Value ¶
func (this *CookiesExpect) Value(value string) *CookiesExpect
type DbRow ¶
type DbRow struct {
// contains filtered or unexported fields
}
func (*DbRow) MustGetFloat ¶
func (*DbRow) MustGetInt ¶
func (*DbRow) MustGetString ¶
type HeadersExpect ¶
type HeadersExpect struct { *ApiExpect // contains filtered or unexported fields }
func (*HeadersExpect) Eq ¶
func (this *HeadersExpect) Eq(name, v string) *HeadersExpect
func (*HeadersExpect) EqAny ¶
func (this *HeadersExpect) EqAny(name string, vs ...string) *HeadersExpect
func (*HeadersExpect) Exist ¶
func (this *HeadersExpect) Exist(name string) *HeadersExpect
func (*HeadersExpect) ExistAny ¶
func (this *HeadersExpect) ExistAny(names ...string) *HeadersExpect
func (*HeadersExpect) NotExist ¶
func (this *HeadersExpect) NotExist(name string) *HeadersExpect
type InterfaceMatchFunc ¶
type InterfaceMatchFunc func(interface{}, interface{}) bool
type JsonExpect ¶
type JsonExpect struct { *ApiExpect // contains filtered or unexported fields }
func (*JsonExpect) Contains ¶
func (this *JsonExpect) Contains(jpath string, value interface{}) *JsonExpect
func (*JsonExpect) ContainsString ¶
func (this *JsonExpect) ContainsString(jpath string, value string) *JsonExpect
func (*JsonExpect) Eq ¶
func (this *JsonExpect) Eq(jpath string, value interface{}) *JsonExpect
func (*JsonExpect) EqAnyFloat ¶
func (this *JsonExpect) EqAnyFloat(jpath string, values ...float64) *JsonExpect
func (*JsonExpect) EqAnyInt ¶
func (this *JsonExpect) EqAnyInt(jpath string, values ...int64) *JsonExpect
func (*JsonExpect) EqAnyString ¶
func (this *JsonExpect) EqAnyString(jpath string, values ...string) *JsonExpect
func (*JsonExpect) FloatContains ¶
func (this *JsonExpect) FloatContains(jpath string, value float64) *JsonExpect
func (*JsonExpect) FloatOnlyContains ¶
func (this *JsonExpect) FloatOnlyContains(jpath string, value float64) *JsonExpect
func (*JsonExpect) Ge ¶
func (this *JsonExpect) Ge(jpath string, value int64) *JsonExpect
func (*JsonExpect) Gt ¶
func (this *JsonExpect) Gt(jpath string, value int64) *JsonExpect
func (*JsonExpect) IntContains ¶
func (this *JsonExpect) IntContains(jpath string, value int64) *JsonExpect
func (*JsonExpect) IntOnlyContains ¶
func (this *JsonExpect) IntOnlyContains(jpath string, value int64) *JsonExpect
func (*JsonExpect) IsNull ¶
func (this *JsonExpect) IsNull(jpath string) *JsonExpect
func (*JsonExpect) Le ¶
func (this *JsonExpect) Le(jpath string, value int64) *JsonExpect
func (*JsonExpect) Lt ¶
func (this *JsonExpect) Lt(jpath string, value int64) *JsonExpect
func (*JsonExpect) Match ¶
func (this *JsonExpect) Match(jpath string, matchFunc InterfaceMatchFunc, value interface{}) *JsonExpect
func (*JsonExpect) MatchAnyString ¶
func (this *JsonExpect) MatchAnyString(jpath string, matchFunc StringMatchFunc, values ...string) *JsonExpect
func (*JsonExpect) MustJsonPahAsFloatArray ¶
func (this *JsonExpect) MustJsonPahAsFloatArray(jpath string) []float64
func (*JsonExpect) MustJsonPahAsInt ¶
func (this *JsonExpect) MustJsonPahAsInt(jpath string) int64
func (*JsonExpect) MustJsonPahAsIntArray ¶
func (this *JsonExpect) MustJsonPahAsIntArray(jpath string) []int64
func (*JsonExpect) MustJsonPahAsStringArray ¶
func (this *JsonExpect) MustJsonPahAsStringArray(jpath string) []string
func (*JsonExpect) MustJsonPathLookup ¶
func (this *JsonExpect) MustJsonPathLookup(jpath string) interface{}
func (*JsonExpect) NotNull ¶
func (this *JsonExpect) NotNull(jpath string) *JsonExpect
func (*JsonExpect) OnlyContains ¶
func (this *JsonExpect) OnlyContains(jpath string, value interface{}) *JsonExpect
func (*JsonExpect) StoreFloat ¶
func (this *JsonExpect) StoreFloat(jpath string, ret *float64) *JsonExpect
func (*JsonExpect) StoreInt ¶
func (this *JsonExpect) StoreInt(jpath string, ret *int64) *JsonExpect
func (*JsonExpect) StoreString ¶
func (this *JsonExpect) StoreString(jpath string, ret *string) *JsonExpect
func (*JsonExpect) StringContains ¶
func (this *JsonExpect) StringContains(jpath string, value string) *JsonExpect
func (*JsonExpect) StringOnlyContains ¶
func (this *JsonExpect) StringOnlyContains(jpath string, value string) *JsonExpect
func (*JsonExpect) Test ¶
func (this *JsonExpect) Test(jpath string, test func(t *testing.T, v interface{})) *JsonExpect
type PlainExpect ¶
type PlainExpect struct { *ApiExpect // contains filtered or unexported fields }
func (*PlainExpect) Contains ¶
func (this *PlainExpect) Contains(restr string) *PlainExpect
func (*PlainExpect) NotContains ¶
func (this *PlainExpect) NotContains(restr string) *PlainExpect
type StatusExpect ¶
type StatusExpect struct { *ApiExpect // contains filtered or unexported fields }
func (*StatusExpect) Eq ¶
func (this *StatusExpect) Eq(code int) *StatusExpect
func (*StatusExpect) EqAny ¶
func (this *StatusExpect) EqAny(codes ...int) *StatusExpect
func (*StatusExpect) NotEq ¶
func (this *StatusExpect) NotEq(code int) *StatusExpect
type StringMatchFunc ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.