test

package
v0.41.13 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: AGPL-3.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqualJSON added in v0.23.0

func AssertEqualJSON(t *testing.T, expected json.RawMessage, actual json.RawMessage, msg string, msgArgs ...interface{}) bool

AssertEqualJSON checks two JSON strings for equality

func AssertXEqual added in v0.33.8

func AssertXEqual(t *testing.T, expected types.XValue, actual types.XValue, msgAndArgs ...interface{}) bool

AssertEqual is equivalent to assert.Equal for two XValue instances

func CreateSessionAssets added in v0.38.0

func CreateSessionAssets(assetsJSON json.RawMessage, testServerURL string) (flows.SessionAssets, error)

CreateSessionAssets creates assets from given JSON

func CreateTestSession

func CreateTestSession(testServerURL string, actionToAdd flows.Action) (flows.Session, []flows.Event, error)

CreateTestSession creates a standard example session for testing

func CreateTestVoiceSession added in v0.24.0

func CreateTestVoiceSession(testServerURL string, actionToAdd flows.Action) (flows.Session, []flows.Event, error)

CreateTestVoiceSession creates a standard example session for testing voice flows and actions

func JSONReplace added in v0.39.0

func JSONReplace(data json.RawMessage, path []string, value json.RawMessage) json.RawMessage

JSONReplace replaces a node in JSON

func LoadFlowFromAssets added in v0.29.0

func LoadFlowFromAssets(path string, uuid assets.FlowUUID) (flows.Flow, error)

func LoadSessionAssets added in v0.25.0

func LoadSessionAssets(path string) (flows.SessionAssets, error)

LoadSessionAssets loads a session assets instance from a static JSON file

func NewChannel added in v0.15.0

func NewChannel(name string, address string, schemes []string, roles []assets.ChannelRole, parent *assets.ChannelReference) *flows.Channel

func NewField added in v0.15.0

func NewField(key string, name string, valueType assets.FieldType) *flows.Field

func NewFixedTimeSource added in v0.40.3

func NewFixedTimeSource(now time.Time) utils.TimeSource

NewFixedTimeSource creates a new fixed time source

func NewGroup added in v0.15.0

func NewGroup(name string, query string) *flows.Group

func NewSeededUUIDGenerator added in v0.40.3

func NewSeededUUIDGenerator(seed int64) utils.UUIDGenerator

NewSeededUUIDGenerator creates a new seeded UUID4 generator from the given seed

func NewSequentialTimeSource added in v0.40.3

func NewSequentialTimeSource(start time.Time) utils.TimeSource

NewSequentialTimeSource creates a new sequential time source

func NewTelChannel added in v0.15.0

func NewTelChannel(name string, address string, roles []assets.ChannelRole, parent *assets.ChannelReference, country string, matchPrefixes []string) *flows.Channel

func NewTestHTTPServer

func NewTestHTTPServer(port int) *httptest.Server

NewTestHTTPServer sets up a mock server for webhook actions

func NormalizeJSON added in v0.23.0

func NormalizeJSON(data json.RawMessage) ([]byte, error)

NormalizeJSON re-formats the given JSON

Types

This section is empty.

Jump to

Keyboard shortcuts

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