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

Method test_realcopy

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

Source from the content-addressed store, hash-verified

1245 self.assertEqual(type(h1._outer), type(h2._outer))
1246
1247 def test_realcopy(self):
1248 # Testing if the copy method created a real copy.
1249 h1 = hmac.HMAC.__new__(hmac.HMAC)
1250 h1._init_old(b"key", b"msg", digestmod="sha256")
1251 h2 = h1.copy()
1252 # Using id() in case somebody has overridden __eq__/__ne__.
1253 self.assertNotEqual(id(h1), id(h2))
1254 self.assertNotEqual(id(h1._inner), id(h2._inner))
1255 self.assertNotEqual(id(h1._outer), id(h2._outer))
1256
1257 def test_equality(self):
1258 # Testing if the copy has the same digests.

Callers

nothing calls this directly

Calls 5

idFunction · 0.85
_init_oldMethod · 0.80
assertNotEqualMethod · 0.80
__new__Method · 0.45
copyMethod · 0.45

Tested by

no test coverage detected