aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utilities_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utilities_tests.py')
-rw-r--r--tests/utilities_tests.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/utilities_tests.py b/tests/utilities_tests.py
index fc9e858f..3ecf8c2b 100644
--- a/tests/utilities_tests.py
+++ b/tests/utilities_tests.py
@@ -1,6 +1,9 @@
import os.path
import unittest
-from StringIO import StringIO
+
+# PYCOMPAT
+import six
+from six import StringIO
from sos.utilities import grep, DirTree, checksum, get_hash_name, is_executable, sos_get_command_output, find, tail, shell_out
import sos
@@ -32,12 +35,12 @@ class TailTest(unittest.TestCase):
def test_tail(self):
t = tail("tests/tail_test.txt", 10)
- self.assertEquals(t, "last line\n")
+ self.assertEquals(t, six.b("last line\n"))
def test_tail_too_many(self):
t = tail("tests/tail_test.txt", 200)
expected = open("tests/tail_test.txt", "r").read()
- self.assertEquals(t, expected)
+ self.assertEquals(t, six.b(expected))
class DirTreeTest(unittest.TestCase):
@@ -78,7 +81,7 @@ class ExecutableTest(unittest.TestCase):
path = os.path.join(TEST_DIR, 'test_exe.py')
ret, out, junk = sos_get_command_output(path)
self.assertEquals(ret, 0)
- self.assertEquals(out, "executed\n")
+ self.assertEquals(out, six.b("executed\n"))
def test_output_non_exe(self):
path = os.path.join(TEST_DIR, 'utility_tests.py')
@@ -88,7 +91,7 @@ class ExecutableTest(unittest.TestCase):
def test_shell_out(self):
path = os.path.join(TEST_DIR, 'test_exe.py')
- self.assertEquals("executed\n", shell_out(path))
+ self.assertEquals(six.b("executed\n"), shell_out(path))
class FindTest(unittest.TestCase):