Replace six.BytesIO with io.BytesIO
authorHarmon <Harmon758@gmail.com>
Sat, 26 Dec 2020 07:57:24 +0000 (01:57 -0600)
committerHarmon <Harmon758@gmail.com>
Sat, 26 Dec 2020 07:57:24 +0000 (01:57 -0600)
tests/test_streaming.py

index 397008a3d94646d34e8c086508dd2608790736a0..349051d75b8eba1d96f5c9b4e33bc1555aad7d24 100644 (file)
@@ -1,3 +1,4 @@
+import io
 import unittest
 from unittest.case import skip
 
@@ -112,7 +113,7 @@ class TweepyStreamReadBufferTests(unittest.TestCase):
 
     def test_read_tweet(self):
         for length in [1, 2, 5, 10, 20, 50]:
-            buf = ReadBuffer(six.BytesIO(self.stream), length)
+            buf = ReadBuffer(io.BytesIO(self.stream), length)
             self.assertEqual('11\n', buf.read_line())
             self.assertEqual('{id:12345}\n', buf.read_len(11))
             self.assertEqual('\n', buf.read_line())
@@ -143,7 +144,7 @@ class TweepyStreamReadBufferTests(unittest.TestCase):
             return ""
 
         # Create a fake stream
-        stream = six.BytesIO(six.b(''))
+        stream = io.BytesIO(six.b(''))
 
         # Mock it's read function so it can't be called too many times
         mock_read = MagicMock(side_effect=on_read)
@@ -164,7 +165,7 @@ class TweepyStreamReadBufferTests(unittest.TestCase):
     def test_read_unicode_tweet(self):
         stream = six.b('11\n{id:12345}\n\n23\n{id:23456, test:"\xe3\x81\x93"}\n\n')
         for length in [1, 2, 5, 10, 20, 50]:
-            buf = ReadBuffer(six.BytesIO(stream), length)
+            buf = ReadBuffer(io.BytesIO(stream), length)
             self.assertEqual('11\n', buf.read_line())
             self.assertEqual('{id:12345}\n', buf.read_len(11))
             self.assertEqual('\n', buf.read_line())