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

Method test_name_attribute

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

Source from the content-addressed store, hash-verified

449 self.assertRaises(exc_types, h.hexdigest, invalid_size)
450
451 def test_name_attribute(self):
452 for cons in self.hash_constructors:
453 h = cons(usedforsecurity=False)
454 self.assertIsInstance(h.name, str)
455 if h.name in self.supported_hash_names:
456 self.assertIn(h.name, self.supported_hash_names)
457 else:
458 self.assertNotIn(h.name, self.supported_hash_names)
459 self.assertEqual(
460 h.name,
461 hashlib.new(h.name, usedforsecurity=False).name
462 )
463
464 def test_large_update(self):
465 aas = b'a' * 128

Callers

nothing calls this directly

Calls 5

assertIsInstanceMethod · 0.80
assertInMethod · 0.80
assertNotInMethod · 0.80
assertEqualMethod · 0.45
newMethod · 0.45

Tested by

no test coverage detected