0
0
mirror of https://github.com/python/cpython.git synced 2024-11-21 12:59:38 +01:00

bpo-14322: added test case for invalid update to hmac (#26636)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
Arjun 2024-02-25 02:33:28 -08:00 committed by GitHub
parent a00b41b9e9
commit 6550b54813
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -479,6 +479,14 @@ class SanityTestCase(unittest.TestCase):
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')