(self)
| 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) |
nothing calls this directly
no test coverage detected