10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d453026 commit 7f02324Copy full SHA for 7f02324
Lib/test/test_hmac.py
@@ -389,6 +389,18 @@ def test_with_digestmod_no_default(self):
389
with self.assertRaisesRegex(TypeError, r'required.*digestmod'):
390
hmac.HMAC(key, msg=data, digestmod='')
391
392
+ # TODO: RUSTPYTHON
393
+ @unittest.expectedFailure
394
+ def test_with_fallback(self):
395
+ cache = getattr(hashlib, '__builtin_constructor_cache')
396
+ try:
397
+ cache['foo'] = hashlib.sha256
398
+ hexdigest = hmac.digest(b'key', b'message', 'foo').hex()
399
+ expected = '6e9ef29b75fffc5b7abae527d58fdadb2fe42e7219011976917343065f58ed4a'
400
+ self.assertEqual(hexdigest, expected)
401
+ finally:
402
+ cache.pop('foo')
403
+
404
405
class ConstructorTestCase(unittest.TestCase):
406
0 commit comments