Documentation ¶
Index ¶
- func Calculate(op interface{}, rvL ...interface{}) (int, error)
- func Concat(input ...interface{}) (string, error)
- func ConcatWithVertical(input ...interface{}) (string, error)
- func GetImageResource(inputRegion, inputZone interface{}) (string, error)
- func GetNotEqual(v interface{}, vL ...interface{}) (string, error)
- func GetRegionImage(input interface{}) (string, error)
- func GetTimestamp(input interface{}) (string, error)
- func GetUDPNRegionResource(input interface{}) (string, error)
- func GetUUID() (string, error)
- func GetValue(obj interface{}, path string) (interface{}, error)
- func GetZoneImage(input interface{}) (string, error)
- func SearchValue(arr interface{}, originKey string, originValue interface{}, destKey string) (interface{}, error)
- func SetReqValue(addr interface{}, field string, values ...interface{}) error
- type Comparators
- type CompareFunc
- type TestCase
- type TestContext
- func (ctx *TestContext) GetVar(name string) interface{}
- func (ctx *TestContext) Must(v interface{}, err error) interface{}
- func (ctx *TestContext) MustString(v string, err error) string
- func (ctx *TestContext) NewValidator(valuePath string, expected interface{}, comparator string) TestValidator
- func (ctx *TestContext) NoError(err error)
- func (ctx *TestContext) SetVar(name string, value interface{})
- type TestValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcatWithVertical ¶
ConcatWithVertical will concat any data as string join with '|'
func GetImageResource ¶
GetImageResource will return the image id for region and zone
func GetNotEqual ¶
GetNotEqual will return the first item of vL that is not equal to v
func GetRegionImage ¶
GetRegionImage will return the image id for region
func GetTimestamp ¶
GetTimestamp will return the timestamp string
func GetUDPNRegionResource ¶
GetUDPNRegionResource the vpc id for udpn peer destinition
func GetZoneImage ¶
GetZoneImage will return the image id for zone
func SearchValue ¶
func SearchValue(arr interface{}, originKey string, originValue interface{}, destKey string) (interface{}, error)
SearchValue will search key/value in an collection and return the value of destination key
func SetReqValue ¶
SetReqValue will set value into pointer referenced or slice
Types ¶
type Comparators ¶
type Comparators struct {
// contains filtered or unexported fields
}
Comparators is a collection of compare functions
func (*Comparators) Get ¶
func (c *Comparators) Get(name string) CompareFunc
Get will return a comparator function by name
type CompareFunc ¶
CompareFunc is the function definition of test comparator without type-system
type TestCase ¶
type TestCase struct { Invoker func() (interface{}, error) Validators []TestValidator MaxRetries int RetryInterval time.Duration T *testing.T }
TestCase is the case definition of test case
type TestContext ¶
type TestContext struct { T *testing.T Vars map[string]interface{} Comparators *Comparators }
TestContext is the fixture of sdk acceptance testing
func NewTestContext ¶
func NewTestContext() TestContext
NewTestContext will return a new TestContext
func (*TestContext) GetVar ¶
func (ctx *TestContext) GetVar(name string) interface{}
GetVar will return the variable of test context
func (*TestContext) Must ¶
func (ctx *TestContext) Must(v interface{}, err error) interface{}
Must will check error is nil and return the value
func (*TestContext) MustString ¶
func (ctx *TestContext) MustString(v string, err error) string
MustString will check error is nil and return the string value
func (*TestContext) NewValidator ¶
func (ctx *TestContext) NewValidator(valuePath string, expected interface{}, comparator string) TestValidator
NewValidator will return new validator to validate value is expected
func (*TestContext) NoError ¶
func (ctx *TestContext) NoError(err error)
NoError will check error is nil
func (*TestContext) SetVar ¶
func (ctx *TestContext) SetVar(name string, value interface{})
SetVar will set the variable of test context
type TestValidator ¶
TestValidator is the validator function