]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added a test of the md5.hexdigest() method. Funny enough, this test
authorBarry Warsaw <barry@python.org>
Tue, 15 Aug 2000 06:01:36 +0000 (06:01 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 15 Aug 2000 06:01:36 +0000 (06:01 +0000)
had yet-another Python implementation of a binary-data-to-hex-digit
encoder!

Lib/test/test_md5.py

index 43f12ca6bfb7ec61e298f102d51ed840f4a4800b..5e453fa2934d359c608bfc4603d2cc5d0518f5c1 100644 (file)
@@ -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'