remotivelabs.topology.testing.hamcrest.matchers

L = list[~T]
class HasLastElement(hamcrest.core.base_matcher.BaseMatcher[list[~T]]):

Matcher that passes if the last element of a list satisfies a nested matcher.

HasLastElement(matcher: hamcrest.core.matcher.Matcher[~T])
matcher
def describe_to(self, description: hamcrest.core.description.Description) -> None:

Generates a description of the object.

The description may be part of a description of a larger object of which this is just a component, so it should be worded appropriately.

Parameters
  • description: The description to be built or appended to.
def has_last_element( matcher: hamcrest.core.matcher.Matcher) -> HasLastElement:

Return a matcher that passes if the last element of a list satisfies matcher.

class EndsWithSequence(hamcrest.core.base_matcher.BaseMatcher[list[~T]]):

Matcher that passes if a list ends with the given sequence.

EndsWithSequence(sequence: list[~T])
sequence
def describe_to(self, description: hamcrest.core.description.Description) -> None:

Generates a description of the object.

The description may be part of a description of a larger object of which this is just a component, so it should be worded appropriately.

Parameters
  • description: The description to be built or appended to.
def ends_with_signal_value_sequence( sequence: list[~T]) -> EndsWithSequence:

Return a matcher that passes if a list ends with sequence.

class ContainsContiguousSublist(hamcrest.core.base_matcher.BaseMatcher[list[~T]]):

Matcher that passes if a list contains the given values as a contiguous subsequence.

Consecutive duplicate values in the observed list are collapsed before matching, unless the expected sublist itself contains consecutive duplicates.

ContainsContiguousSublist(*sublist: ~T)
sublist
def describe_to(self, description: hamcrest.core.description.Description) -> None:

Generates a description of the object.

The description may be part of a description of a larger object of which this is just a component, so it should be worded appropriately.

Parameters
  • description: The description to be built or appended to.
def contains_signal_value_sequence( *sublist: ~T) -> ContainsContiguousSublist:

Return a matcher that passes if a list contains sublist as a contiguous subsequence.

class ContainsContiguousSubdict(hamcrest.core.base_matcher.BaseMatcher[dict[str, list[~T]] | dict[str, dict[str, list[~T]]]]):

Matcher that passes if each key in a dict maps to a list containing the expected subsequence.

ContainsContiguousSubdict(expected: dict[str, list[~T]] | dict[str, dict[str, list[~T]]])
expected
matchers: dict[str, hamcrest.core.base_matcher.BaseMatcher]
def describe_to(self, description: hamcrest.core.description.Description) -> None:

Generates a description of the object.

The description may be part of a description of a larger object of which this is just a component, so it should be worded appropriately.

Parameters
  • description: The description to be built or appended to.
def contains_signal_value_sequences( expected: dict[str, list[~T]] | dict[str, dict[str, list[~T]]]) -> ContainsContiguousSubdict:

Return a matcher that passes if each key in a dict contains its expected subsequence.