From 4e6f9bafedbd444e6d33e079804a78c8213411dd Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Wed, 27 Oct 2021 12:39:33 +0200 Subject: [PATCH] Fix test_wc Change-Id: If052b158dedaaef2d442669565f01bd7f54ab7ef --- tobiko/tests/functional/shell/test_wc.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tobiko/tests/functional/shell/test_wc.py b/tobiko/tests/functional/shell/test_wc.py index 2b839561d..65c4b98c3 100644 --- a/tobiko/tests/functional/shell/test_wc.py +++ b/tobiko/tests/functional/shell/test_wc.py @@ -45,9 +45,10 @@ class WcTest(testtools.TestCase): sh.get_file_size, file_name) self.assertEqual(1, ex.exit_status) - self.assertEqual( - f"wc: {file_name}: No such file or directory\n", - ex.stderr) + self.assertIn( + ex.stderr.strip(), + [f"wc: {file_name}: No such file or directory", + f"wc: {file_name}: open: No such file or directory"]) def test_assert_file_size(self): file_name = os.path.join(sh.make_temp_dir(), @@ -68,9 +69,10 @@ class WcTest(testtools.TestCase): sh.assert_file_size, 1, file_name) self.assertEqual(1, ex.exit_status) - self.assertEqual( - f"wc: {file_name}: No such file or directory\n", - ex.stderr) + self.assertIn( + ex.stderr.strip(), + [f"wc: {file_name}: No such file or directory", + f"wc: {file_name}: open: No such file or directory"]) def test_assert_file_size_when_mismatch(self): file_name = os.path.join(sh.make_temp_dir(),