ó {G_Tc@s´dZddlZejddeƒejddeƒddlZddlZddlZddlZddlm Z dej fd„ƒYZ d „Z e d kr°e ƒndS( sV Test suite to check compilance with PEP 247, the standard API for hashing algorithms iÿÿÿÿNtignoresthe md5 module is deprecated.*sthe sha module is deprecated.*(t test_supportt Pep247TestcBs/eZdd„Zd„Zd„Zd„ZRS(c Cs|jt|dƒƒ|j|jdkp7|jdkƒ|dk r«|j|ƒ}|j|dƒ}|j|dƒjƒ}|j|ƒ}|jdƒ|jƒ}nU|jƒ}|jdƒ}|jdƒjƒ}|jƒ}|jdƒ|jƒ}|j||ƒ|jt|dƒƒ|jdk rN|j|j|jƒn|j|jt|ƒƒ|jdƒ|j ƒ}|j|jƒ|jƒƒ|j|j ƒ|j ƒƒ|jƒ|j ƒ} } d} x"| D]} | dt | ƒ7} qÞW|j| | ƒdS(Nt digest_sizeitstringts%02x( t assertTruethasattrRtNonetnewtdigesttupdatet assertEqualtlentcopyt hexdigesttord( tselftmoduletkeytobj1tobj2th1tobj3th2tobj_copyR Rthd2tbyte((s,/usr/local/lib/python2.7/test/test_pep247.pyt check_modules:%         cCs|jtƒdS(N(Rtmd5(R((s,/usr/local/lib/python2.7/test/test_pep247.pyttest_md5=scCs|jtƒdS(N(Rtsha(R((s,/usr/local/lib/python2.7/test/test_pep247.pyttest_sha@scCs|jtddƒdS(NRtabc(Rthmac(R((s,/usr/local/lib/python2.7/test/test_pep247.pyt test_hmacCsN(t__name__t __module__RRRR R#(((s,/usr/local/lib/python2.7/test/test_pep247.pyRs (  cCstjtƒdS(N(Rt run_unittestR(((s,/usr/local/lib/python2.7/test/test_pep247.pyt test_mainFst__main__(t__doc__twarningstfilterwarningstDeprecationWarningR"RRtunittestttestRtTestCaseRR'R$(((s,/usr/local/lib/python2.7/test/test_pep247.pyts       3