MCPcopy Index your code
hub / github.com/python/cpython / test_algorithms_available

Method test_algorithms_available

Lib/test/test_hashlib.py:232–243  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

230 if _algo.islower()))
231
232 def test_algorithms_available(self):
233 self.assertTrue(set(hashlib.algorithms_guaranteed).
234 issubset(hashlib.algorithms_available))
235 # all available algorithms must be loadable, bpo-47101
236 self.assertNotIn("undefined", hashlib.algorithms_available)
237 for name in hashlib.algorithms_available:
238 with self.subTest(name):
239 try:
240 _ = hashlib.new(name, usedforsecurity=False)
241 except ValueError as exc:
242 self.skip_if_blake2_not_builtin(name, exc)
243 raise
244
245 def test_usedforsecurity_true(self):
246 hashlib.new("sha256", usedforsecurity=True)

Callers

nothing calls this directly

Calls 7

setFunction · 0.85
assertTrueMethod · 0.80
issubsetMethod · 0.80
assertNotInMethod · 0.80
subTestMethod · 0.45
newMethod · 0.45

Tested by

no test coverage detected