From e4a885545c27b513bc8b1d19fbadc3d654bab435 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Thu, 27 Dec 2018 08:08:19 -0500 Subject: [PATCH] Remove unnecessary alias 'bytes_type' Both Python 2 & Python 3 have the type `bytes`. On Python 2, it is an alias of str, same as what was previously defined. Makes the code slightly more forward compatible with Python 3 syntax. --- tests/test_oauth1_session.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_oauth1_session.py b/tests/test_oauth1_session.py index 183244b2..45050d8a 100644 --- a/tests/test_oauth1_session.py +++ b/tests/test_oauth1_session.py @@ -17,10 +17,8 @@ if sys.version[0] == '3': unicode_type = str - bytes_type = bytes else: unicode_type = unicode - bytes_type = str TEST_RSA_KEY = ( @@ -74,7 +72,7 @@ def test_signature_types(self): def verify_signature(getter): def fake_send(r, **kwargs): signature = getter(r) - if isinstance(signature, bytes_type): + if isinstance(signature, bytes): signature = signature.decode('utf-8') self.assertIn('oauth_signature', signature) resp = mock.MagicMock(spec=requests.Response) @@ -320,7 +318,7 @@ def test_authorized_true_rsa(self, generate_nonce, generate_timestamp): def verify_signature(self, signature): def fake_send(r, **kwargs): auth_header = r.headers['Authorization'] - if isinstance(auth_header, bytes_type): + if isinstance(auth_header, bytes): auth_header = auth_header.decode('utf-8') self.assertEqual(auth_header, signature) resp = mock.MagicMock(spec=requests.Response)