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

Method test_with_fallback

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

Source from the content-addressed store, hash-verified

1501
1502 @hashlib_helper.requires_hashdigest('sha256')
1503 def test_with_fallback(self):
1504 cache = getattr(hashlib, '__builtin_constructor_cache')
1505 try:
1506 cache['foo'] = hashlib.sha256
1507 hexdigest = hmac.digest(b'key', b'message', 'foo').hex()
1508 expected = ('6e9ef29b75fffc5b7abae527d58fdadb'
1509 '2fe42e7219011976917343065f58ed4a')
1510 self.assertEqual(hexdigest, expected)
1511 finally:
1512 cache.pop('foo')
1513
1514 @hashlib_helper.requires_openssl_hashdigest("md5")
1515 @bigmemtest(size=_4G + 5, memuse=2, dry_run=False)

Callers

nothing calls this directly

Calls 4

hexMethod · 0.45
digestMethod · 0.45
assertEqualMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected