From a80825dbb9e28306d9d2dac8114f00f03cce0c9a Mon Sep 17 00:00:00 2001 From: Bryan Quigley Date: Tue, 11 Aug 2020 17:05:37 -0700 Subject: [travis,style] Upgrade to 20.04 and cover more in tests Signed-off-by: Bryan Quigley Signed-off-by: Jake Hunsaker --- tests/utilities_tests.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/utilities_tests.py') diff --git a/tests/utilities_tests.py b/tests/utilities_tests.py index fa861563..64be9f1e 100644 --- a/tests/utilities_tests.py +++ b/tests/utilities_tests.py @@ -11,15 +11,17 @@ import unittest # PYCOMPAT from io import StringIO -from sos.utilities import grep, is_executable, sos_get_command_output, find, tail, shell_out -import sos +from sos.utilities import (grep, is_executable, sos_get_command_output, + find, tail, shell_out) TEST_DIR = os.path.dirname(__file__) + class GrepTest(unittest.TestCase): def test_file_obj(self): - test_s = u"\n".join(['this is only a test', 'there are only two lines']) + test_s = u"\n".join( + ['this is only a test', 'there are only two lines']) test_fo = StringIO(test_s) matches = grep(".*test$", test_fo) self.assertEquals(matches, ['this is only a test\n']) @@ -33,7 +35,8 @@ class GrepTest(unittest.TestCase): self.assertEquals(matches, ['import unittest\n']) def test_grep_multiple_files(self): - matches = grep(".*unittest$", __file__.replace(".pyc", ".py"), "does_not_exist.txt") + matches = grep(".*unittest$", + __file__.replace(".pyc", ".py"), "does_not_exist.txt") self.assertEquals(matches, ['import unittest\n']) -- cgit