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

Method test_equality

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

Source from the content-addressed store, hash-verified

1255 self.assertNotEqual(id(h1._outer), id(h2._outer))
1256
1257 def test_equality(self):
1258 # Testing if the copy has the same digests.
1259 h1 = hmac.HMAC(b"key", digestmod="sha256")
1260 h1.update(b"some random text")
1261 h2 = h1.copy()
1262 self.assertEqual(h1.digest(), h2.digest())
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().

Callers

nothing calls this directly

Calls 7

updateMethod · 0.95
copyMethod · 0.95
digestMethod · 0.95
hexdigestMethod · 0.95
HMACMethod · 0.45
assertEqualMethod · 0.45
digestMethod · 0.45

Tested by

no test coverage detected