summaryrefslogtreecommitdiff
path: root/Lib/test/test_hashlib.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2010-09-06 08:30:23 +0000
committerGregory P. Smith <greg@mad-scientist.com>2010-09-06 08:30:23 +0000
commit13b55291ac84d2fb74f93c286a0bd5673f439e38 (patch)
tree3be269bb34eb782e9ec28a92b3f07d1b95b32c4f /Lib/test/test_hashlib.py
parentc86adb4c5c616e6aa7dcf9e59c71ba66ab5ea553 (diff)
downloadcpython-git-13b55291ac84d2fb74f93c286a0bd5673f439e38.tar.gz
hashlib has two new constant attributes: algorithms_guaranteed and
algorithms_avaiable that respectively list the names of hash algorithms guaranteed to exist in all Python implementations and the names of hash algorithms available in the current process. Renames the attribute new in 3.2a0 'algorithms' to 'algorithms_guaranteed'.
Diffstat (limited to 'Lib/test/test_hashlib.py')
-rw-r--r--Lib/test/test_hashlib.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index 4fb693e8fa..c8db6a86ac 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -101,11 +101,15 @@ class HashLibTestCase(unittest.TestCase):
c = cons(a)
c.hexdigest()
- def test_algorithms_attribute(self):
- self.assertEqual(hashlib.algorithms,
+ def test_algorithms_guaranteed(self):
+ self.assertEqual(hashlib.algorithms_guaranteed,
tuple(_algo for _algo in self.supported_hash_names
if _algo.islower()))
+ def test_algorithms_available(self):
+ self.assertTrue(set(hashlib.algorithms_guaranteed).
+ issubset(hashlib.algorithms_available))
+
def test_unknown_hash(self):
try:
hashlib.new('spam spam spam spam spam')