From dc1a9c8a101ad679af4f8952f83b27369c30ce77 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sat, 26 Dec 2020 01:57:24 -0600 Subject: [PATCH] Replace six.BytesIO with io.BytesIO --- tests/test_streaming.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_streaming.py b/tests/test_streaming.py index 397008a..349051d 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@ -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()) -- 2.25.1