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

Method test_copy

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

Source from the content-addressed store, hash-verified

384 self.assertEqual(sorted(builtin_constructor_cache), ['MD5', 'md5'])
385
386 def test_copy(self):
387 for cons in self.hash_constructors:
388 h1 = cons(os.urandom(16), usedforsecurity=False)
389 h2 = h1.copy()
390 self.assertIs(type(h1), type(h2))
391 self.assertEqual(h1.name, h2.name)
392 size = (16,) if h1.name in self.shakes else ()
393 self.assertEqual(h1.digest(*size), h2.digest(*size))
394 self.assertEqual(h1.hexdigest(*size), h2.hexdigest(*size))
395
396 def test_hexdigest(self):
397 for cons in self.hash_constructors:

Callers

nothing calls this directly

Calls 5

hexdigestMethod · 0.80
copyMethod · 0.45
assertIsMethod · 0.45
assertEqualMethod · 0.45
digestMethod · 0.45

Tested by

no test coverage detected