assert

package
v0.0.0-...-e63e094 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package assert provides testing helpers and assertion wrappers for flow engine tests

Index

Constants

View Source
const DefaultRetryInterval = 100 * time.Millisecond

DefaultRetryInterval is the default polling interval for Eventually checks

Variables

This section is empty.

Functions

This section is empty.

Types

type FlowRef

type FlowRef struct {
	Getter Getter
	FlowID api.FlowID
}

FlowRef groups a Getter and FlowID for assertion helpers

type Getter

type Getter interface {
	GetAttribute(flowID api.FlowID, attr api.Name) (any, bool, error)
}

type Wrapper

type Wrapper struct {
	*testing.T
	*assert.Assertions
	Require *assert.Assertions
}

Wrapper wraps testify assertions with Argyll-specific helpers

func New

func New(t *testing.T) *Wrapper

New creates a new test assertion wrapper with both assert and require from testify plus Argyll-specific helpers

func (*Wrapper) ConfigInvalid

func (w *Wrapper) ConfigInvalid(cfg *config.Config, contains string)

ConfigInvalid asserts that a configuration is invalid

func (*Wrapper) ConfigValid

func (w *Wrapper) ConfigValid(cfg *config.Config)

ConfigValid asserts that a configuration is valid

func (*Wrapper) Eventually

func (w *Wrapper) Eventually(
	condition func() bool, timeout time.Duration, msg string,
)

Eventually runs a condition repeatedly until it passes or times out

func (*Wrapper) EventuallyWithError

func (w *Wrapper) EventuallyWithError(
	condition func() error, timeout time.Duration, msg string,
)

EventuallyWithError runs a condition that returns an error until it succeeds or times out

func (*Wrapper) FlowHasState

func (w *Wrapper) FlowHasState(ref FlowRef, keys ...api.Name)

FlowHasState asserts that a flow has specific state keys

func (*Wrapper) FlowStateEquals

func (w *Wrapper) FlowStateEquals(ref FlowRef, key api.Name, expected any)

FlowStateEquals asserts that a state key has the expected value

func (*Wrapper) FlowStatus

func (w *Wrapper) FlowStatus(flow api.FlowState, expected api.FlowStatus)

FlowStatus asserts the status of a flow

func (*Wrapper) StepInvalid

func (w *Wrapper) StepInvalid(t *api.Step, expectedErrorContains string)

StepInvalid asserts that a step is invalid

func (*Wrapper) StepValid

func (w *Wrapper) StepValid(t *api.Step)

StepValid asserts that a step is valid

Directories

Path Synopsis
Package helpers provides additional testing helper functions
Package helpers provides additional testing helper functions
Package wait provides event waiting helpers for engine tests
Package wait provides event waiting helpers for engine tests

Jump to

Keyboard shortcuts

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