aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utilities_tests.py
diff options
context:
space:
mode:
authorBryan Quigley <code@bryanquigley.com>2020-08-11 17:05:37 -0700
committerJake Hunsaker <jhunsake@redhat.com>2020-08-13 10:14:16 -0400
commita80825dbb9e28306d9d2dac8114f00f03cce0c9a (patch)
treefe41aa8d78fdc91e6b058fe070ecac4556d63182 /tests/utilities_tests.py
parent1ec1bcc94f7e51fd934d851c215e6fddeb3102ad (diff)
downloadsos-a80825dbb9e28306d9d2dac8114f00f03cce0c9a.tar.gz
[travis,style] Upgrade to 20.04 and cover more in tests
Signed-off-by: Bryan Quigley <code@bryanquigley.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Diffstat (limited to 'tests/utilities_tests.py')
-rw-r--r--tests/utilities_tests.py11
1 files changed, 7 insertions, 4 deletions
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'])