[3.11] bpo-14322: added test case for invalid update to hmac (GH-26636) (#115905)

Co-authored-by: Arjun <ccldarjun@icloud.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2024-02-25 11:52:55 +01:00 committed by GitHub
parent a9f8cf03f1
commit c6455ff0fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -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')