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

Method test_equality_new

Lib/test/test_hmac.py:1265–1273  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1263 self.assertEqual(h1.hexdigest(), h2.hexdigest())
1264
1265 def test_equality_new(self):
1266 # Testing if the copy has the same digests with hmac.new().
1267 h1 = hmac.new(b"key", digestmod="sha256")
1268 h1.update(b"some random text")
1269 h2 = h1.copy()
1270 # Using id() in case somebody has overridden __eq__/__ne__.
1271 self.assertNotEqual(id(h1), id(h2))
1272 self.assertEqual(h1.digest(), h2.digest())
1273 self.assertEqual(h1.hexdigest(), h2.hexdigest())
1274
1275
1276class ExtensionCopyTestCase(CopyBaseTestCase):

Callers

nothing calls this directly

Calls 8

idFunction · 0.85
assertNotEqualMethod · 0.80
hexdigestMethod · 0.80
newMethod · 0.45
updateMethod · 0.45
copyMethod · 0.45
assertEqualMethod · 0.45
digestMethod · 0.45

Tested by

no test coverage detected