summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_hmac.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-05-31 19:20:00 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-05-31 19:20:00 (GMT)
commitc2aa09ad8055ba3e03da297608552d04b42e9aac (patch)
treed349deae79ade87b4e39098d067e114f50e1bcbb /Lib/test/test_hmac.py
parent03b75fa4e1331d4c9f5ff6385ff54fb522bc4cab (diff)
downloadcpython-c2aa09ad8055ba3e03da297608552d04b42e9aac.zip
cpython-c2aa09ad8055ba3e03da297608552d04b42e9aac.tar.gz
cpython-c2aa09ad8055ba3e03da297608552d04b42e9aac.tar.bz2
Have the sha module raise a DeprecationWarning as specified in PEP 4.
Diffstat (limited to 'Lib/test/test_hmac.py')
-rw-r--r--Lib/test/test_hmac.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py
index 9d094d2..d28490d 100644
--- a/Lib/test/test_hmac.py
+++ b/Lib/test/test_hmac.py
@@ -1,5 +1,5 @@
import hmac
-import sha
+from hashlib import sha1
import unittest
from test import test_support
@@ -43,7 +43,7 @@ class TestVectorsTestCase(unittest.TestCase):
def test_sha_vectors(self):
def shatest(key, data, digest):
- h = hmac.HMAC(key, data, digestmod=sha)
+ h = hmac.HMAC(key, data, digestmod=sha1)
self.assertEqual(h.hexdigest().upper(), digest.upper())
shatest(chr(0x0b) * 20,
@@ -95,11 +95,11 @@ class ConstructorTestCase(unittest.TestCase):
def test_withmodule(self):
# Constructor call with text and digest module.
- import sha
+ from hashlib import sha1
try:
- h = hmac.HMAC("key", "", sha)
+ h = hmac.HMAC("key", "", sha1)
except:
- self.fail("Constructor call with sha module raised exception.")
+ self.fail("Constructor call with hashlib.sha1 raised exception.")
class SanityTestCase(unittest.TestCase):