From: Barry Warsaw Date: Tue, 15 Aug 2000 06:01:36 +0000 (+0000) Subject: Added a test of the md5.hexdigest() method. Funny enough, this test X-Git-Tag: v2.0b1~450 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3fdcccb82fe8578722b94a18b76fe9d791e7a6e4;p=thirdparty%2FPython%2Fcpython.git 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! --- diff --git a/Lib/test/test_md5.py b/Lib/test/test_md5.py index 43f12ca6bfb7..5e453fa2934d 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'