neotest

package
v3.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FixedTime func() time.Time

FixedTime is always at 2016-01-05T15:04:05-06:00

Functions

func CloneTestData

func CloneTestData(t *testing.T) (string, func())

CloneTestData clones the test data into a temporary directory and changes the working directory to the temporary directory. The function returned should be run as a deferred to restore the working directory and remove the files.

func Dump

func Dump(t *testing.T, i interface{})

Dump i to stdout using JSON

func LoadJSON

func LoadJSON(t *testing.T, path string, dst interface{})

LoadJSON unmarshals JSON for a test

func Must

func Must(t *testing.T, err error)

Must calls fatal in the given test if err is non-nil

Types

type TestOutput

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

TestOutput can be used in place of the normal monitor outut to provide a simpler way of testing monitor output.

func NewTestOutput

func NewTestOutput() *TestOutput

NewTestOutput creates a new initialized TestOutput instance

func (*TestOutput) SendDatapoint

func (to *TestOutput) SendDatapoint(dp *datapoint.Datapoint)

SendDatapoint accepts a datapoint and sticks it in a buffered queue

func (*TestOutput) SendDimensionProps

func (to *TestOutput) SendDimensionProps(dimProps *types.DimProperties)

SendDimensionProps accepts a dim prop update and sticks it in a buffered queue

func (*TestOutput) SendEvent

func (to *TestOutput) SendEvent(event *event.Event)

SendEvent accepts an event and sticks it in a buffered queue

func (*TestOutput) WaitForDPs

func (to *TestOutput) WaitForDPs(count, waitSeconds int) []*datapoint.Datapoint

WaitForDPs will keep pulling datapoints off of the internal queue until it either gets the expected count or waitSeconds seconds have elapsed. It then returns those datapoints. It will never return more than 'count' datapoints.

func (*TestOutput) WaitForDimensionProps

func (to *TestOutput) WaitForDimensionProps(count, waitSeconds int) []*types.DimProperties

WaitForDimensionProps will keep pulling dimension property updates off of the internal queue until it either gets the expected count or waitSeconds seconds have elapsed. It then returns those dimension property updates. It will never return more than 'count' objects.

Directories

Path Synopsis
k8s

Jump to

Keyboard shortcuts

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