bpo-38132: Simplify _hashopenssl code (GH-16023)

Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
Christian Heimes 2019-09-12 14:42:07 +02:00 committed by Stéphane Wirtel
parent a488879cba
commit 5a4f82f457
4 changed files with 391 additions and 122 deletions

View file

@ -194,6 +194,9 @@ class HashLibTestCase(unittest.TestCase):
self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')
self.assertRaises(TypeError, hashlib.new, 1)
def test_new_upper_to_lower(self):
self.assertEqual(hashlib.new("SHA256").name, "sha256")
def test_get_builtin_constructor(self):
get_builtin_constructor = getattr(hashlib,
'__get_builtin_constructor')