MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_with_fallback

Method test_with_fallback

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

Source from the content-addressed store, hash-verified

1547
1548 @hashlib_helper.requires_hashdigest('sha256')
1549 def test_with_fallback(self):
1550 cache = getattr(hashlib, '__builtin_constructor_cache')
1551 try:
1552 cache['foo'] = hashlib.sha256
1553 hexdigest = hmac.digest(b'key', b'message', 'foo').hex()
1554 expected = ('6e9ef29b75fffc5b7abae527d58fdadb'
1555 '2fe42e7219011976917343065f58ed4a')
1556 self.assertEqual(hexdigest, expected)
1557 finally:
1558 cache.pop('foo')
1559
1560 @hashlib_helper.requires_openssl_hashdigest("md5")
1561 @bigmemtest(size=_4G + 5, memuse=2, dry_run=False)

Callers

nothing calls this directly

Calls 5

getattrFunction · 0.85
hexMethod · 0.45
digestMethod · 0.45
assertEqualMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected