From 69ab82435dc25072cd44280cee6389677729c1ca Mon Sep 17 00:00:00 2001 From: Michel Hidalgo <michel@ekumenlabs.com> Date: Wed, 15 May 2019 17:05:02 -0300 Subject: [PATCH] Add regression test for regex based output matching. Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com> --- .../test/launch_testing/test_io_handler_and_assertions.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/launch_testing/test/launch_testing/test_io_handler_and_assertions.py b/launch_testing/test/launch_testing/test_io_handler_and_assertions.py index 31dcbea8a..c0b33161d 100644 --- a/launch_testing/test/launch_testing/test_io_handler_and_assertions.py +++ b/launch_testing/test/launch_testing/test_io_handler_and_assertions.py @@ -13,6 +13,7 @@ # limitations under the License. import os +import re import sys import unittest @@ -157,6 +158,13 @@ def test_strict_proc_matching_false(self): strict_proc_matching=False ) + def test_regex_matching(self): + assertInStdout( + self.proc_output, + re.compile(r'Called with arguments \S+'), + 'terminating_proc-2' + ) + def test_arguments_disambiguate_processes(self): txt = self.EXPECTED_TEXT assertInStdout(self.proc_output, txt, 'terminating_proc', '--extra')