summaryrefslogtreecommitdiff
path: root/tests/oauth1/rfc5849
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-09-14 05:07:46 -0700
committerJon Dufresne <jon.dufresne@gmail.com>2018-09-14 05:18:10 -0700
commit8aa89569f14b493ba2672d7a64c7c1c138c82c3b (patch)
treeb8e9b177925b36e57ed1f24bfc2f2bc203cc1e1b /tests/oauth1/rfc5849
parenta49c773fe4a7e0912a19057cb783e3a71b46435c (diff)
downloadoauthlib-8aa89569f14b493ba2672d7a64c7c1c138c82c3b.tar.gz
Remove unnecessary workaround for bytes type
The type 'bytes' is available on all supported Pythons. Likewise the byte literal b'...' is available on all supported Pythons. Use idiomatic Python and remove workaround for an issue that no longer exists. Makes the code more forward compatible with Python 3.
Diffstat (limited to 'tests/oauth1/rfc5849')
-rw-r--r--tests/oauth1/rfc5849/test_client.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/oauth1/rfc5849/test_client.py b/tests/oauth1/rfc5849/test_client.py
index 777efc2..ab6f8da 100644
--- a/tests/oauth1/rfc5849/test_client.py
+++ b/tests/oauth1/rfc5849/test_client.py
@@ -5,7 +5,7 @@ from oauthlib.common import Request
from oauthlib.oauth1 import (SIGNATURE_PLAINTEXT, SIGNATURE_HMAC_SHA1,
SIGNATURE_HMAC_SHA256, SIGNATURE_RSA,
SIGNATURE_TYPE_BODY, SIGNATURE_TYPE_QUERY)
-from oauthlib.oauth1.rfc5849 import Client, bytes_type
+from oauthlib.oauth1.rfc5849 import Client
from ...unittest import TestCase
@@ -39,7 +39,7 @@ class ClientConstructorTests(TestCase):
def test_convert_to_unicode_resource_owner(self):
client = Client('client-key',
resource_owner_key=b'owner key')
- self.assertFalse(isinstance(client.resource_owner_key, bytes_type))
+ self.assertFalse(isinstance(client.resource_owner_key, bytes))
self.assertEqual(client.resource_owner_key, 'owner key')
def test_give_explicit_timestamp(self):
@@ -57,11 +57,11 @@ class ClientConstructorTests(TestCase):
uri, headers, body = client.sign('http://a.b/path?query',
http_method='POST', body='a=b',
headers={'Content-Type': 'application/x-www-form-urlencoded'})
- self.assertIsInstance(uri, bytes_type)
- self.assertIsInstance(body, bytes_type)
+ self.assertIsInstance(uri, bytes)
+ self.assertIsInstance(body, bytes)
for k, v in headers.items():
- self.assertIsInstance(k, bytes_type)
- self.assertIsInstance(v, bytes_type)
+ self.assertIsInstance(k, bytes)
+ self.assertIsInstance(v, bytes)
def test_hmac_sha1(self):
client = Client('client_key')