tests

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClockFromContext

func ClockFromContext(ctx context.Context) clockwork.FakeClock

ClockFromContext returns clock or panics.

func ConfigureTracer

func ConfigureTracer(m *testing.M)

ConfigureTracer starts the tracer.

func FilterInteraction

func FilterInteraction(i *cassette.Interaction) error

FilterInteraction removes secret arguments from the URL.

func IsRecording

func IsRecording() bool

IsRecording returns true if the recording mode is enabled

func MatchInteraction

func MatchInteraction(r *http.Request, i cassette.Request) bool

MatchInteraction checks if the request matches a store request in the given cassette.

func ReadFixture

func ReadFixture(path string) (string, error)

ReadFixture opens the file at path and returns the contents as a string

func Recorder

func Recorder(ctx context.Context, t *testing.T) (*recorder.Recorder, error)

Recorder intercepts HTTP requests.

func RestoreClock

func RestoreClock(t *testing.T) clockwork.FakeClock

RestoreClock restore current time from .freeze file.

func Retry

func Retry(interval time.Duration, count int, call func() bool) error

Retry calls the call function for count times every interval while it returns false

func SetClock

func SetClock(t *testing.T) clockwork.FakeClock

SetClock stores current time in .freeze file.

func WithClock

func WithClock(ctx context.Context, t *testing.T) context.Context

WithClock sets clock to context.

func WithTestSpan

func WithTestSpan(ctx context.Context, t *testing.T) (context.Context, func())

WithTestSpan starts new span with test information.

func WrapRoundTripper

func WrapRoundTripper(rt http.RoundTripper, opts ...ddhttp.RoundTripperOption) http.RoundTripper

WrapRoundTripper includes tracing information.

Types

type Assertions

type Assertions struct {
	require.Assertions
}

Assertions wrapper

func Assert

func Assert(ctx context.Context, t *testing.T) *Assertions

Assert wraps context and testing object.

type TestingT

type TestingT struct {
	*testing.T
	// contains filtered or unexported fields
}

TestingT keeps track of a context.

func (*TestingT) Errorf

func (t *TestingT) Errorf(format string, args ...interface{})

Errorf format error message.

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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