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:
parent
a00b41b9e9
commit
6550b54813
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user