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



This section is empty.


This section is empty.


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.


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