Documentation

Overview

Package testing exports helper functions to streamline testing core Sparta codepaths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertSuccess

func AssertSuccess(t *testing.T, didError error) error

AssertSuccess is a default handler for the ProvisionRunner. If no evaluator is supplied, defaults to expecting no didError

func Provision

func Provision(t *testing.T,
	lambdaAWSInfos []*sparta.LambdaAWSInfo,
	evaluator ProvisionEvaluator)

Provision is a convenience function for ProvisionEx

func ProvisionEx

func ProvisionEx(t *testing.T,
	lambdaAWSInfos []*sparta.LambdaAWSInfo,
	api *sparta.API,
	site *sparta.S3Site,
	workflowHooks *sparta.WorkflowHooks,
	useCGO bool,
	evaluator ProvisionEvaluator)

ProvisionEx handles mock provisioning a service and then supplying the result to the evaluator function. If no evaluator is performed it's assumed that the provision operation should succeed without error.

Types

type ProvisionEvaluator

type ProvisionEvaluator func(t *testing.T, didError error) error

ProvisionEvaluator is the function that is called following a provision to determine if the result was successful

func AssertError

func AssertError(message string) ProvisionEvaluator

AssertError returns a test evaluator that enforces that didError is not nil