test_utils

package
v0.0.0-...-efdc0dc Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadChainsInfo

func LoadChainsInfo(env string) ([]cns.Chain, error)

func LoadClientChainsInfo

func LoadClientChainsInfo(env string) ([]chainclient.ChainClient, error)

func LoadIngressInfo

func LoadIngressInfo(env string) (EmerisIngress, EmerisAdminIngress, error)

func RespBodyToMap

func RespBodyToMap(jsonReader io.ReadCloser, data *map[string]interface{}, t *testing.T)

func RetryOnError

func RetryOnError(f func() error, interval time.Duration, maxRetries int) error

func StringToMap

func StringToMap(jsonString []byte, data *map[string]interface{}, t *testing.T)

Types

type BaseTestSuite

type BaseTestSuite struct {
	suite.Suite
	Env       string
	EmIngress EmerisIngress
	Chains    []cns.Chain
	Client    *HttpClient
}

func (*BaseTestSuite) SetupTest

func (suite *BaseTestSuite) SetupTest()

type EmerisAdminIngress

type EmerisAdminIngress struct {
	Host          string
	Protocol      string
	CNSServerPath string
}

type EmerisIngress

type EmerisIngress struct {
	Host            string
	Protocol        string
	APIServerPath   string
	LiquidityPath   string
	PriceOraclePath string
}

type HttpClient

type HttpClient struct {
	*http.Client
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient(env, scheme, host, basePath string) (*HttpClient, error)

func (*HttpClient) BuildUrl

func (c *HttpClient) BuildUrl(path string, args ...interface{}) string

func (*HttpClient) DoJson

func (c *HttpClient) DoJson(method string, jsonIn interface{}, jsonOut interface{}, endpoint string, endpointParams ...interface{}) error

DoJson performs a HTTP request sending jsonIn as body and unmarshalling jsonOut.

func (*HttpClient) GetJson

func (c *HttpClient) GetJson(jsonOut interface{}, endpoint string, endpointParams ...interface{}) error

GetJson performs a GET request and unmarshalls jsonOut.

Jump to

Keyboard shortcuts

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