test

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	APIKey    = "9d7831d8-03f1-4b4c-a1c3-97272ddefe6a" //nolint:gosec
	UserAgent = "go-katapult/test"
)

Functions

func AssertContext added in v0.1.5

func AssertContext(t *testing.T, want, got context.Context)

AssertContext asserts that both given contexts has the same test key value set.

func Context added in v0.1.5

func Context(parent context.Context) context.Context

Context returns a new context.Context with a random value assigned to the test key value using WithContext. Returns nil if parent context is nil.

func CustomJSONMarshaling

func CustomJSONMarshaling(
	t *testing.T,
	input interface{},
	decoded interface{},
)

func FromContext added in v0.1.5

func FromContext(ctx context.Context) string

FromContext returns the test context value.

func WithContext added in v0.1.5

func WithContext(ctx context.Context, value string) context.Context

WithContext returns a new child context with the test context key set to value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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