summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_md5.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2000-08-15 06:01:36 (GMT)
committerBarry Warsaw <barry@python.org>2000-08-15 06:01:36 (GMT)
commit3fdcccb82fe8578722b94a18b76fe9d791e7a6e4 (patch)
tree22e84ed0f50c7fef4368dd381a9464ebfc8194a1 /Lib/test/test_md5.py
parent4ef4be53ac907941a22b5b5fdc5b540bf9510759 (diff)
downloadcpython-3fdcccb82fe8578722b94a18b76fe9d791e7a6e4.zip
cpython-3fdcccb82fe8578722b94a18b76fe9d791e7a6e4.tar.gz
cpython-3fdcccb82fe8578722b94a18b76fe9d791e7a6e4.tar.bz2
Added a test of the md5.hexdigest() method. Funny enough, this test
had yet-another Python implementation of a binary-data-to-hex-digit encoder!
Diffstat (limited to 'Lib/test/test_md5.py')
-rw-r--r--Lib/test/test_md5.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_md5.py b/Lib/test/test_md5.py
index 43f12ca..5e453fa 100644
--- a/Lib/test/test_md5.py
+++ b/Lib/test/test_md5.py
@@ -22,3 +22,9 @@ print md5test('message digest')
print md5test('abcdefghijklmnopqrstuvwxyz')
print md5test('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789')
print md5test('12345678901234567890123456789012345678901234567890123456789012345678901234567890')
+
+# hexdigest is new with Python 2.0
+m = md5('testing the hexdigest method')
+h = m.hexdigest()
+if hexstr(m.digest()) <> h:
+ print 'hexdigest() failed'