assertions

package
v1.115.0-devpreview Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match_AbsentProperty

func Match_AbsentProperty() *string

Use this matcher in the place of a field's value, if the field must not be present. Experimental.

func Matcher_IsMatcher

func Matcher_IsMatcher(x interface{}) *bool

Check whether the provided object is a subtype of the `IMatcher`. Experimental.

func NewMatchResult_Override

func NewMatchResult_Override(m MatchResult)

Experimental.

func NewMatch_Override

func NewMatch_Override(m Match)

Experimental.

func NewMatcher_Override

func NewMatcher_Override(m Matcher)

Experimental.

Types

type Match

type Match interface {
}

Partial and special matching during template assertions. Experimental.

type MatchResult

type MatchResult interface {
	FailCount() *float64
	Compose(id *string, inner MatchResult) MatchResult
	HasFailed() *bool
	Push(matcher Matcher, path *[]*string, message *string) MatchResult
	ToHumanStrings() *[]*string
}

The result of `Match.test()`. Experimental.

func NewMatchResult

func NewMatchResult() MatchResult

Experimental.

type Matcher

type Matcher interface {
	Name() *string
	Test(actual interface{}) MatchResult
}

Represents a matcher that can perform special data matching capabilities between a given pattern and a target. Experimental.

func Match_ArrayEquals

func Match_ArrayEquals(pattern *[]interface{}) Matcher

Matches the specified pattern with the array found in the same relative path of the target.

The set of elements (or matchers) must match exactly and in order. Experimental.

func Match_ArrayWith

func Match_ArrayWith(pattern *[]interface{}) Matcher

Matches the specified pattern with the array found in the same relative path of the target.

The set of elements (or matchers) must be in the same order as would be found. Experimental.

func Match_Exact

func Match_Exact(pattern interface{}) Matcher

Deep exact matching of the specified pattern to the target. Experimental.

func Match_ObjectEquals

func Match_ObjectEquals(pattern *map[string]interface{}) Matcher

Matches the specified pattern to an object found in the same relative path of the target.

The keys and their values (or matchers) must match exactly with the target. Experimental.

func Match_ObjectLike

func Match_ObjectLike(pattern *map[string]interface{}) Matcher

Matches the specified pattern to an object found in the same relative path of the target.

The keys and their values (or matchers) must be present in the target but the target can be a superset. Experimental.

type TemplateAssertions

type TemplateAssertions interface {
	HasResource(type_ *string, props interface{})
	HasResourceProperties(type_ *string, props interface{})
	ResourceCountIs(type_ *string, count *float64)
	TemplateMatches(expected *map[string]interface{})
}

Suite of assertions that can be run on a CDK stack.

Typically used, as part of unit tests, to validate that the rendered CloudFormation template has expected resources and properties. Experimental.

func TemplateAssertions_FromStack

func TemplateAssertions_FromStack(stack awscdk.Stack) TemplateAssertions

Base your assertions on the CloudFormation template synthesized by a CDK `Stack`. Experimental.

func TemplateAssertions_FromString

func TemplateAssertions_FromString(template *string) TemplateAssertions

Base your assertions from an existing CloudFormation template formatted as a string. Experimental.

func TemplateAssertions_FromTemplate

func TemplateAssertions_FromTemplate(template *map[string]interface{}) TemplateAssertions

Base your assertions from an existing CloudFormation template formatted as a nested set of records. Experimental.

Jump to

Keyboard shortcuts

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