Ñò
‘à"Ic        	   @   s¶   d  Z  d d k Z e i d d e ƒ e i d d e ƒ d d k Z d d k Z d d k Z d d k Z d d k l	 Z	 d e i
 f d „  ƒ  YZ d	 „  Z e d
 j o e ƒ  n d S(   sV   
Test suite to check compilance with PEP 247, the standard API
for hashing algorithms
iÿÿÿÿNt   ignores   the md5 module is deprecated.*s   the sha module is deprecated.*(   t   test_supportt
   Pep247Testc           B   s/   e  Z d d  „ Z d „  Z d „  Z d „  Z RS(   c         C   s  |  i  t | d ƒ ƒ |  i  | i d  j p | i d j ƒ | d  j	 oe | i | ƒ } | i | d ƒ } | i | d ƒ i ƒ  } | i | ƒ } | i d ƒ | i ƒ  } nV | i ƒ  } | i d ƒ } | i d ƒ i ƒ  } | i ƒ  } | i d ƒ | i ƒ  } |  i | | ƒ |  i  t | d ƒ ƒ | i d  j	 o |  i | i | i ƒ n |  i | i t | ƒ ƒ | i d ƒ | i	 ƒ  } |  i | i ƒ  | i ƒ  ƒ |  i | i
 ƒ  | i
 ƒ  ƒ | i ƒ  | i
 ƒ  }	 }
 d } x" |	 D] } | d t | ƒ 7} qãW|  i | |
 ƒ d  S(   Nt   digest_sizei    t   stringt    s   %02x(   t   assert_t   hasattrR   t   Nonet   newt   digestt   updatet   assertEqualst   lent   copyt	   hexdigestt   ord(   t   selft   modulet   keyt   obj1t   obj2t   h1t   obj3t   h2t   obj_copyR
   R   t   hd2t   byte(    (    s-   /mit/python/lib/python2.6/test/test_pep247.pyt   check_module   s<    & c         C   s   |  i  t ƒ d  S(   N(   R   t   md5(   R   (    (    s-   /mit/python/lib/python2.6/test/test_pep247.pyt   test_md5=   s    c         C   s   |  i  t ƒ d  S(   N(   R   t   sha(   R   (    (    s-   /mit/python/lib/python2.6/test/test_pep247.pyt   test_sha@   s    c         C   s   |  i  t d d ƒd  S(   NR   t   abc(   R   t   hmac(   R   (    (    s-   /mit/python/lib/python2.6/test/test_pep247.pyt	   test_hmacC   s    N(   t   __name__t
   __module__R   R   R   R    R#   (    (    (    s-   /mit/python/lib/python2.6/test/test_pep247.pyR      s   (		c           C   s   t  i t ƒ d  S(   N(   R   t   run_unittestR   (    (    (    s-   /mit/python/lib/python2.6/test/test_pep247.pyt	   test_mainF   s    t   __main__(   t   __doc__t   warningst   filterwarningst   DeprecationWarningR"   R   R   t   unittestt   testR   t   TestCaseR   R'   R$   (    (    (    s-   /mit/python/lib/python2.6/test/test_pep247.pyt   <module>   s   3	