mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Issue 18532: Added tests and documentation to formally specify the .name attribute on hashlib objects.
This commit is contained in:
parent
21e9ac7c1a
commit
b2aa6f4055
2 changed files with 17 additions and 0 deletions
|
@ -154,6 +154,11 @@ class HashLibTestCase(unittest.TestCase):
|
|||
assert isinstance(h.digest(), bytes), name
|
||||
self.assertEqual(hexstr(h.digest()), h.hexdigest())
|
||||
|
||||
def test_name_attribute(self):
|
||||
for cons in self.hash_constructors:
|
||||
h = cons()
|
||||
assert isinstance(h.name, str), "No name attribute"
|
||||
assert h.name in self.supported_hash_names
|
||||
|
||||
def test_large_update(self):
|
||||
aas = b'a' * 128
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue