test

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Finish

func Finish()

Finish deactivates HTTP mocking and clears the registered URLs, undoing Start.

func Get

func Get(url string) []byte

Get performs an HTTP GET and returns the response body, panicking on error.

func LoadFile

func LoadFile(filename string) []byte

LoadFile reads the named file from the test data directory and returns its contents, panicking on error.

func Start

func Start(set TestDataset)

Start activates HTTP mocking and registers the responders for the given test dataset. It panics if two datasets register the same URL.

Types

type TestDataset

type TestDataset int
const (
	Bootstrap TestDataset = iota
	BootstrapExperimental
	BootstrapMalformed
	BootstrapComplex
	BootstrapHTTPError

	Responses
)

Jump to

Keyboard shortcuts

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