launch_testing.tools.text module

launch_testing.tools.text.build_line_match(expected_lines, *, strict=False)

Make a callable to match lines with expected_lines.

Parameters:

expected_lines – line expectation to match against

Returns:

a callable that matches text against the expectation.

Return type:

Callable[bool, [str]]

launch_testing.tools.text.build_text_match(expected_text, *, strict=False)

Make a callable to match text with expected_text.

Parameters:

expected_text (str or regex pattern or List[Union[str, regex pattern]]) – text expectation to match against

Returns:

a callable that matches text against the expectation.

Return type:

Callable[bool, [str]]

launch_testing.tools.text.normalize_lineseps(lines)

Normalize and then return the given lines to all use ‘n’.