https://github.com/python/cpython/commit/6dbf85ce546dcb7438468e04e931cf9503b84263 commit: 6dbf85ce546dcb7438468e04e931cf9503b84263 branch: 3.12 author: Miss Islington (bot) <[email protected]> committer: hugovk <[email protected]> date: 2024-02-25T10:49:37Z summary:
[3.12] bpo-14322: added test case for invalid update to hmac (GH-26636) (#115904) Co-authored-by: Arjun <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]> files: M Lib/test/test_hmac.py diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py index a39a2c45ebc2e2..1502fba9f3e8b8 100644 --- a/Lib/test/test_hmac.py +++ b/Lib/test/test_hmac.py @@ -479,6 +479,14 @@ def test_exercise_all_methods(self): self.fail("Exception raised during normal usage of HMAC class.") +class UpdateTestCase(unittest.TestCase): + @hashlib_helper.requires_hashdigest('sha256') + def test_with_str_update(self): + with self.assertRaises(TypeError): + h = hmac.new(b"key", digestmod='sha256') + h.update("invalid update") + + class CopyTestCase(unittest.TestCase): @hashlib_helper.requires_hashdigest('sha256') _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
