diff options
author | Thomas Kluyver <takowl@gmail.com> | 2013-09-23 11:29:08 -0700 |
---|---|---|
committer | Thomas Kluyver <takowl@gmail.com> | 2013-09-23 11:29:08 -0700 |
commit | ada77b55de931f774faad15812b9f6d9a996392a (patch) | |
tree | 594f07762eacef3e1784b41491c6d74242b7539a /tests/test_log.py | |
parent | bf1dcd269edb62aa99d8e1ce00212afc2b2e1773 (diff) | |
download | pexpect-git-ada77b55de931f774faad15812b9f6d9a996392a.tar.gz |
Don't use six for tests
Diffstat (limited to 'tests/test_log.py')
-rwxr-xr-x | tests/test_log.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/test_log.py b/tests/test_log.py index 519e774..d0d148a 100755 --- a/tests/test_log.py +++ b/tests/test_log.py @@ -18,16 +18,14 @@ PEXPECT LICENSE OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ''' -from __future__ import with_statement # bring 'with' stmt to py25 import pexpect import unittest import os import tempfile import PexpectTestCase -from pexpect import six # the program cat(1) may display ^D\x08\x08 when \x04 (EOF, Ctrl-D) is sent -_CAT_EOF = six.b('^D\x08\x08') +_CAT_EOF = b'^D\x08\x08' class TestCaseLog(PexpectTestCase.PexpectTestCase): @@ -59,11 +57,11 @@ class TestCaseLog(PexpectTestCase.PexpectTestCase): with open(filename, 'rb') as f: lf = f.read() os.unlink (filename) - lf = lf.replace(_CAT_EOF, six.b('')) - self.assertEqual(lf, six.b('This is a test.\r\nThis is a test.\r\n')) + lf = lf.replace(_CAT_EOF, b'') + self.assertEqual(lf, b'This is a test.\r\nThis is a test.\r\n') def test_log_logfile_send (self): - log_message = six.b('This is a test.') + log_message = b'This is a test.' filename = tempfile.mktemp() mylog = open (filename, 'wb') p = pexpect.spawn('cat') @@ -76,7 +74,7 @@ class TestCaseLog(PexpectTestCase.PexpectTestCase): with open(filename, 'rb') as f: lf = f.read() os.unlink(filename) - lf = lf.replace(six.b('\x04'), six.b('')) + lf = lf.replace(b'\x04', b'') self.assertEqual(lf.rstrip(), log_message) def test_log_send_and_received (self): @@ -99,9 +97,9 @@ class TestCaseLog(PexpectTestCase.PexpectTestCase): with open(filename, 'rb') as f: lf = f.read() os.unlink(filename) - lf = lf.replace(six.b('\x04'), six.b('')).replace(_CAT_EOF, six.b('')) + lf = lf.replace(b'\x04', b'').replace(_CAT_EOF, b'') self.assertEqual(lf, - six.b('This is a test.\nThis is a test.\r\nThis is a test.\r\n')) + b'This is a test.\nThis is a test.\r\nThis is a test.\r\n') if __name__ == '__main__': unittest.main() |