Match

class aws_cdk.assertions.Match

Bases: object

Partial and special matching during template assertions.

Static Methods

classmethod absent()

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

Return type:

Matcher

classmethod any_value()

Matches any non-null value at the target.

Return type:

Matcher

classmethod array_equals(pattern)

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.

Parameters:

pattern (Sequence[Any]) – the pattern to match.

Return type:

Matcher

classmethod array_with(pattern)

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.

Parameters:

pattern (Sequence[Any]) – the pattern to match.

Return type:

Matcher

classmethod exact(pattern)

Deep exact matching of the specified pattern to the target.

Parameters:

pattern (Any) – the pattern to match.

Return type:

Matcher

classmethod not_(pattern)

Matches any target which does NOT follow the specified pattern.

Parameters:

pattern (Any) – the pattern to NOT match.

Return type:

Matcher

classmethod object_equals(pattern)

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.

Parameters:

pattern (Mapping[str, Any]) – the pattern to match.

Return type:

Matcher

classmethod object_like(pattern)

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.

Parameters:

pattern (Mapping[str, Any]) – the pattern to match.

Return type:

Matcher

classmethod serialized_json(pattern)

Matches any string-encoded JSON and applies the specified pattern after parsing it.

Parameters:

pattern (Any) – the pattern to match after parsing the encoded JSON.

Return type:

Matcher

classmethod string_like_regexp(pattern)

Matches targets according to a regular expression.

Parameters:

pattern (str) –

Return type:

Matcher