Lines Matching refs:h1
487 h1 = hmac.HMAC.__new__(hmac.HMAC)
488 h1._init_old(b"key", b"msg", digestmod="sha256")
489 h2 = h1.copy()
490 self.assertEqual(type(h1._inner), type(h2._inner),
492 self.assertEqual(type(h1._outer), type(h2._outer),
498 h1 = hmac.HMAC.__new__(hmac.HMAC)
499 h1._init_old(b"key", b"msg", digestmod="sha256")
500 h2 = h1.copy()
502 self.assertTrue(id(h1) != id(h2), "No real copy of the HMAC instance.")
503 self.assertTrue(id(h1._inner) != id(h2._inner),
505 self.assertTrue(id(h1._outer) != id(h2._outer),
507 self.assertIs(h1._hmac, None)
512 h1 = hmac.HMAC.__new__(hmac.HMAC)
513 h1._init_hmac(b"key", b"msg", digestmod="sha256")
514 h2 = h1.copy()
515 self.assertTrue(id(h1._hmac) != id(h2._hmac))
520 h1 = hmac.HMAC(b"key", digestmod="sha256")
521 h1.update(b"some random text")
522 h2 = h1.copy()
523 self.assertEqual(h1.digest(), h2.digest(),
525 self.assertEqual(h1.hexdigest(), h2.hexdigest(),
531 h1 = hmac.new(b"key", digestmod="sha256")
532 h1.update(b"some random text")
533 h2 = h1.copy()
535 id(h1) != id(h2), "No real copy of the HMAC instance."
537 self.assertEqual(h1.digest(), h2.digest(),
539 self.assertEqual(h1.hexdigest(), h2.hexdigest(),