summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-08-03 09:39:39 (GMT)
committerJason R. Coombs <jaraco@jaraco.com>2013-08-03 09:39:39 (GMT)
commitb2aa6f40559da92085e77a247b8756d860171a12 (patch)
tree515da7c5a74232209caaba85dedde4dce8c7ae36 /Lib
parent21e9ac7c1ae4923031e01bfe0da59ef1b593a342 (diff)
downloadcpython-b2aa6f40559da92085e77a247b8756d860171a12.zip
cpython-b2aa6f40559da92085e77a247b8756d860171a12.tar.gz
cpython-b2aa6f40559da92085e77a247b8756d860171a12.tar.bz2
Issue 18532: Added tests and documentation to formally specify the .name attribute on hashlib objects.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_hashlib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index 2601209..e944bde 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -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