summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_hmac.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py
index a39a2c4..1502fba 100644
--- a/Lib/test/test_hmac.py
+++ b/Lib/test/test_hmac.py
@@ -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')