testing

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapRenderPath added in v0.4.3

func MapRenderPath(raw *url.URL, params map[string]interface{}) error

func RenderPath added in v0.4.3

func RenderPath(raw *url.URL, vstring string) error

func RenderReqPath added in v0.4.3

func RenderReqPath(req *curl.Request, param interface{}) error

Types

type ApiReturnAssume added in v0.4.3

type ApiReturnAssume struct {
	Httpstatus int
	BodySchema string
}

func ApiAssume added in v0.4.3

func ApiAssume() *ApiReturnAssume

func (*ApiReturnAssume) BodyVerifyBy added in v0.4.3

func (r *ApiReturnAssume) BodyVerifyBy(schema string) *ApiReturnAssume

very Body by jsonschema write in yaml

func (*ApiReturnAssume) Status added in v0.4.3

func (r *ApiReturnAssume) Status(s int) *ApiReturnAssume

func (*ApiReturnAssume) Verify added in v0.4.3

func (r *ApiReturnAssume) Verify(res *curl.Response) error

type ApiTestCase added in v0.4.3

type ApiTestCase struct {
	Method string
	Path   string
	Action TestApiAction
}

func NewApiCase added in v0.4.3

func NewApiCase(method, path string, action TestApiAction) *ApiTestCase

func (*ApiTestCase) Run added in v0.5.2

func (c *ApiTestCase) Run(ctx *HTTPTestContext) error

type EtcdV3ConfigLoader

type EtcdV3ConfigLoader struct {
	Config     *etcdctl.Config
	Key        string
	ConfigType string
}

EtcdV3ConfigLoader config loader load config from etcdv3

func NewEtcdV3ConfigLoader

func NewEtcdV3ConfigLoader(endpoint, key string) *EtcdV3ConfigLoader

NewEtcdV3ConfigLoader create a etcdv3 config loader

func (*EtcdV3ConfigLoader) LoadConfig

func (l *EtcdV3ConfigLoader) LoadConfig(vc *viper.Viper) error

LoadConfig implement config loader

type HTTPTestCase added in v0.5.2

type HTTPTestCase interface {
	Run(ctx *HTTPTestContext) error
}

type HTTPTestContext added in v0.4.3

type HTTPTestContext struct {
	// contains filtered or unexported fields
}

func NewHTTPTestContext added in v0.4.3

func NewHTTPTestContext(client *curl.Client) *HTTPTestContext

func (*HTTPTestContext) AddExtraClient added in v0.4.3

func (c *HTTPTestContext) AddExtraClient(key string, client *curl.Client)

func (*HTTPTestContext) ExtraFetchAndAssume added in v0.4.3

func (c *HTTPTestContext) ExtraFetchAndAssume(key string, req *curl.Request, assume *ApiReturnAssume) (res *curl.Response, err error)

func (*HTTPTestContext) FetchAndAssume added in v0.4.3

func (c *HTTPTestContext) FetchAndAssume(req *curl.Request, assume *ApiReturnAssume) (res *curl.Response, err error)

func (*HTTPTestContext) Get added in v0.4.3

func (c *HTTPTestContext) Get(key interface{}) (value interface{}, ok bool)

func (*HTTPTestContext) GetInt added in v0.4.3

func (c *HTTPTestContext) GetInt(key interface{}) (value int, ok bool)

func (*HTTPTestContext) GetString added in v0.4.3

func (c *HTTPTestContext) GetString(key interface{}) (value string, ok bool)

func (*HTTPTestContext) Set added in v0.4.3

func (c *HTTPTestContext) Set(key, value interface{})

type JobAction added in v0.5.2

type JobAction func(ctx *HTTPTestContext) error

type JobTestCase added in v0.5.2

type JobTestCase struct {
	// contains filtered or unexported fields
}

func NewJobCase added in v0.5.2

func NewJobCase(action JobAction) *JobTestCase

func (*JobTestCase) Run added in v0.5.2

func (c *JobTestCase) Run(ctx *HTTPTestContext) error

type TestApiAction added in v0.4.3

type TestApiAction func(ctx *HTTPTestContext, req *curl.Request) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL