mirror of https://github.com/python/cpython
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.")
|
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):
|
class CopyTestCase(unittest.TestCase):
|
||||||
|
|
||||||
@hashlib_helper.requires_hashdigest('sha256')
|
@hashlib_helper.requires_hashdigest('sha256')
|
||||||
|
|
Loading…
Reference in New Issue