mirror of
https://github.com/python/cpython.git
synced 2026-01-26 21:03:34 +00:00
[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:
parent
a9f8cf03f1
commit
c6455ff0fd
@ -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…
x
Reference in New Issue
Block a user