testutil

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FixtureBasePath = filepath.Join(
	build.Default.GOPATH,
	"src",
	"github.com/omise/omise-go",
	"testdata/fixtures",
)

Functions

func AssertJSONEquals

func AssertJSONEquals(t *testing.T, m1 map[string]interface{}, m2 map[string]interface{})

func FixturePath

func FixturePath(req *http.Request) (int, string, error)

func Keys

func Keys() (string, string)

func LogObj

func LogObj(t *testing.T, obj interface{})

func Main

func Main(m *testing.M)

func Require

func Require(t *testing.T, env string)

Types

type FixturesTransport

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

func NewFixturesTransport

func NewFixturesTransport() (*FixturesTransport, error)

func (*FixturesTransport) RoundTrip

func (transport *FixturesTransport) RoundTrip(req *http.Request) (*http.Response, error)

type RecorderTransport

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

func NewRecorderTransport

func NewRecorderTransport() (*RecorderTransport, error)

func (*RecorderTransport) RoundTrip

func (transport *RecorderTransport) RoundTrip(req *http.Request) (*http.Response, error)

type TestClient

type TestClient struct {
	*testing.T
	*omise.Client
}

func NewFixedClient

func NewFixedClient(t *testing.T) *TestClient

func NewTestClient

func NewTestClient(t *testing.T) *TestClient

func (*TestClient) MustDo

func (tc *TestClient) MustDo(result interface{}, op internal.Operation)

Jump to

Keyboard shortcuts

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