Remove unused import
[pyelftools.git] / test / test_utils.py
index 00e6137e5ab3a63572741d7edea8a1dbf1ff8fc5..b74f2e51f83fff4728adcb546b06e4c24b9a83cc 100644 (file)
@@ -10,7 +10,7 @@ except ImportError:
     import unittest
 from random import randint
 
-from test.utils import setup_syspath; setup_syspath()
+from utils import setup_syspath; setup_syspath()
 from elftools.common.py3compat import int2byte, BytesIO
 from elftools.common.utils import (parse_cstring_from_stream,
         preserve_stream_pos)
@@ -45,17 +45,17 @@ class Test_parse_cstring_from_stream(unittest.TestCase):
         self.assertEqual(parse_cstring_from_stream(sio, 2348), text[2348:5000])
 
 
-class Test_preserve_stream_pos(object):
+class Test_preserve_stream_pos(unittest.TestCase):
     def test_basic(self):
-        sio = BytesIO('abcdef')
+        sio = BytesIO(b'abcdef')
         with preserve_stream_pos(sio):
             sio.seek(4)
-        self.assertEqual(stream.tell(), 0)
+        self.assertEqual(sio.tell(), 0)
 
         sio.seek(5)
         with preserve_stream_pos(sio):
             sio.seek(0)
-        self.assertEqual(stream.tell(), 5)
+        self.assertEqual(sio.tell(), 5)
 
 
 if __name__ == '__main__':