test

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2018 License: AGPL-3.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestHTTPClient = utils.NewHTTPClient("goflow-testing")

TestHTTPClient a HTTP client instance for tests

Functions

func CreateSession added in v0.9.10

func CreateSession(sessionAssets json.RawMessage) (flows.Session, error)

CreateSession creates a session with the given assets

func CreateTestSession

func CreateTestSession(testServerPort int, actionToAdd flows.Action) (flows.Session, error)

CreateTestSession creates a standard example session for testing

func NewTestEnvironment added in v0.9.4

func NewTestEnvironment(dateFormat utils.DateFormat, tz *time.Location, now *time.Time) utils.Environment

NewTestEnvironment creates a new test environment

func NewTestHTTPServer

func NewTestHTTPServer(port int) (*httptest.Server, error)

NewTestHTTPServer sets up a mock server for webhook actions

Types

type TestEnvironment added in v0.9.10

type TestEnvironment struct {
	utils.Environment
	// contains filtered or unexported fields
}

TestEnvironment an extended environment that will let us override Now() so that it's constant

func (*TestEnvironment) Now added in v0.9.10

func (e *TestEnvironment) Now() time.Time

func (*TestEnvironment) SetNow added in v0.9.10

func (e *TestEnvironment) SetNow(now time.Time)

Jump to

Keyboard shortcuts

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