Skip to content

Commit

Permalink
Merge pull request #473 from jdufresne/assertequal
Browse files Browse the repository at this point in the history
Replace all uses of assertEquals with assertEqual
  • Loading branch information
thedrow committed Jul 30, 2017
2 parents 103a951 + e3626c4 commit 008ebbd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion tests/oauth1/rfc5849/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_register_method(self):

u, h, b = client.sign('http://example.com')

self.assertEquals(h['Authorization'], (
self.assertEqual(h['Authorization'], (
'OAuth oauth_nonce="abc", oauth_timestamp="1234567890", '
'oauth_version="1.0", oauth_signature_method="PIZZA", '
'oauth_consumer_key="client_key", '
Expand Down
35 changes: 17 additions & 18 deletions tests/oauth1/rfc5849/test_signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ def test_normalize_base_string_uri(self):

# test a URI with the default port
uri = "http://www.example.com:80/"
self.assertEquals(normalize_base_string_uri(uri),
"http://www.example.com/")
self.assertEqual(normalize_base_string_uri(uri),
"http://www.example.com/")

# test a URI missing a path
uri = "http://www.example.com"
self.assertEquals(normalize_base_string_uri(uri),
"http://www.example.com/")
self.assertEqual(normalize_base_string_uri(uri),
"http://www.example.com/")

# test a relative URI
uri = "/a-host-relative-uri"
Expand All @@ -158,14 +158,14 @@ def test_normalize_base_string_uri(self):
# test overriding the URI's netloc with a host argument
uri = "http://www.example.com/a-path"
host = "alternatehost.example.com"
self.assertEquals(normalize_base_string_uri(uri, host),
"http://alternatehost.example.com/a-path")
self.assertEqual(normalize_base_string_uri(uri, host),
"http://alternatehost.example.com/a-path")

def test_collect_parameters(self):
"""We check against parameters multiple times in case things change
after more parameters are added.
"""
self.assertEquals(collect_parameters(), [])
self.assertEqual(collect_parameters(), [])

# Check against uri_query
parameters = collect_parameters(uri_query=self.uri_query)
Expand Down Expand Up @@ -241,8 +241,8 @@ def test_sign_hmac_sha1(self):
sign = sign_hmac_sha1(self.control_base_string,
self.client_secret.decode('utf-8'),
self.resource_owner_secret.decode('utf-8'))
self.assertEquals(len(sign), 28)
self.assertEquals(sign, self.control_signature)
self.assertEqual(len(sign), 28)
self.assertEqual(sign, self.control_signature)

def test_sign_hmac_sha1_with_client(self):
self.assertRaises(ValueError,
Expand All @@ -254,8 +254,8 @@ def test_sign_hmac_sha1_with_client(self):
sign = sign_hmac_sha1_with_client(
self.control_base_string, self.client)

self.assertEquals(len(sign), 28)
self.assertEquals(sign, self.control_signature)
self.assertEqual(len(sign), 28)
self.assertEqual(sign, self.control_signature)


control_base_string_rsa_sha1 = (
Expand Down Expand Up @@ -309,9 +309,9 @@ def test_sign_rsa_sha1(self):
control_signature = self.control_signature_rsa_sha1

sign = sign_rsa_sha1(base_string, private_key)
self.assertEquals(sign, control_signature)
self.assertEqual(sign, control_signature)
sign = sign_rsa_sha1(base_string.decode('utf-8'), private_key)
self.assertEquals(sign, control_signature)
self.assertEqual(sign, control_signature)


def test_sign_rsa_sha1_with_client(self):
Expand All @@ -323,13 +323,13 @@ def test_sign_rsa_sha1_with_client(self):

sign = sign_rsa_sha1_with_client(base_string, self.client)

self.assertEquals(sign, control_signature)
self.assertEqual(sign, control_signature)

self.client.decode() ## Decode `rsa_private_key` from UTF-8

sign = sign_rsa_sha1_with_client(base_string, self.client)

self.assertEquals(sign, control_signature)
self.assertEqual(sign, control_signature)


control_signature_plaintext = (
Expand All @@ -343,7 +343,7 @@ def test_sign_plaintext(self):
self.resource_owner_secret)
sign = sign_plaintext(self.client_secret.decode('utf-8'),
self.resource_owner_secret.decode('utf-8'))
self.assertEquals(sign, self.control_signature_plaintext)
self.assertEqual(sign, self.control_signature_plaintext)


def test_sign_plaintext_with_client(self):
Expand All @@ -354,5 +354,4 @@ def test_sign_plaintext_with_client(self):

sign = sign_plaintext_with_client(None, self.client)

self.assertEquals(sign, self.control_signature_plaintext)

self.assertEqual(sign, self.control_signature_plaintext)

0 comments on commit 008ebbd

Please sign in to comment.