ó
‹wÛjc           @   s´  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l m Z d  d l m	 Z	 e j
 d ƒ d k Z d e j f d „  ƒ  YZ e j Z d e f d	 „  ƒ  YZ d
 Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ e ` d e f d „  ƒ  YZ d e f d „  ƒ  YZ e ` d e e f d „  ƒ  YZ d e e f d „  ƒ  YZ d e e f d „  ƒ  YZ d e f d „  ƒ  YZ d e j f d „  ƒ  YZ d e f d „  ƒ  YZ d e j f d  „  ƒ  YZ d! e j f d" „  ƒ  YZ d# e f d$ „  ƒ  YZ d% e f d& „  ƒ  YZ  d' e f d( „  ƒ  YZ! d) e f d* „  ƒ  YZ" d+ e f d, „  ƒ  YZ# d- e# f d. „  ƒ  YZ$ d/ e# f d0 „  ƒ  YZ% d1 e# f d2 „  ƒ  YZ& d3 „  Z' e( d4 k r°e' ƒ  n  d S(5   iÿÿÿÿN(   t   test_support(   t   Hashablet   li   t   HashEqualityTestCasec           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         G   sO   t  t | ƒ } x9 | d D]- } | | d k r |  j d | f ƒ q q Wd  S(   Ni   i    s   hashed values differ: %r(   t   mapt   hasht   fail(   t   selft   objlistt   hashedt   h(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt	   same_hash   s    c         C   s\   |  j  d d d d ƒ |  j  d d d d ƒ |  j  d d	 d
 d ƒ |  j  d d d d ƒ d  S(   Ni   l    g      ð?y                i    l    g        iÿÿÿÿlÿÿÿÿ g      ð¿iþÿÿÿlÿÿÿÿ g       Ày      ð?        y                y      ð¿        y       À        (   R   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_numeric_literals   s    c         C   se  |  j  t d ƒ t d ƒ t d ƒ t d ƒ t d ƒ t d ƒ ƒ |  j  t d ƒ t d
 ƒ t d ƒ ƒ |  j  t d d ƒ t d d ƒ t d d ƒ ƒ |  j  t d ƒ t d ƒ t d ƒ ƒ |  j  t d ƒ t d ƒ t d ƒ ƒ |  j  t d ƒ t d ƒ t d ƒ ƒ |  j  t d d ƒ t d d  ƒ ƒ |  j  t d" ƒ t d$ ƒ ƒ |  j  t d% ƒ t d& ƒ ƒ d  S('   Ni   t   1s   1.0i   i   i?   I   €    i   €I   €    i   €I   €    i   €I   €    I   €    I   €    I   €    iÿÿÿI   €    iÿÿÿI   €    iÿÿÿI   €    I   €    I   €    l            lûÿÿÿ         l            lûÿÿÿ         l            lûÿÿÿ         l            l            l            l   ÿÿÿÿ l            l   ÿÿÿÿ l            l            (   R   t   intt   longt   floatt   complex(   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_coerced_integers#   s    *%1%%%$c         C   s?   |  j  t d ƒ t d ƒ ƒ |  j  t d ƒ t d d ƒ ƒ d  S(   NgÑì�ˆøb=~g      à?g        (   R   R   R   R   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_coerced_floats0   s    (   t   __name__t
   __module__R   R   R   R   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR      s   			t   DefaultHashc           B   s   e  Z RS(    (   R   R   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR   6   s    i*   t	   FixedHashc           B   s   e  Z d  „  Z RS(   c         C   s   t  S(   N(   t   _FIXED_HASH_VALUE(   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   __hash__:   s    (   R   R   R   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR   9   s   t   OnlyEqualityc           B   s   e  Z d  „  Z d Z RS(   c         C   s
   |  | k S(   N(    (   R   t   other(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   __eq__>   s    N(   R   R   R   t   NoneR   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR   =   s   	t   OnlyInequalityc           B   s   e  Z d  „  Z RS(   c         C   s
   |  | k	 S(   N(    (   R   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   __ne__E   s    (   R   R   R   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR   D   s   t   OnlyCmpc           B   s   e  Z d  „  Z d Z RS(   c         C   s   t  t |  ƒ t | ƒ ƒ S(   N(   t   cmpt   id(   R   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   __cmp__I   s    N(   R   R   R#   R   R   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR    H   s   	t   InheritedHashWithEqualityc           B   s   e  Z RS(    (   R   R   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR$   O   s    t   InheritedHashWithInequalityc           B   s   e  Z RS(    (   R   R   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR%   P   s    t   InheritedHashWithCmpc           B   s   e  Z RS(    (   R   R   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR&   Q   s    t   NoHashc           B   s   e  Z d  Z RS(   N(   R   R   R   R   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR'   S   s   t   HashInheritanceTestCasec           B   sƒ   e  Z e ƒ  e ƒ  e ƒ  e ƒ  e ƒ  g Z e ƒ  e	 ƒ  e
 ƒ  e ƒ  g Z e ƒ  g Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s4   x- |  j  D]" } |  j t | ƒ t | ƒ ƒ q
 Wd  S(   N(   t   default_expectedt   assertEqualR   t   _default_hash(   R   t   obj(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_default_hashd   s    c         C   s.   x' |  j  D] } |  j t | ƒ t ƒ q
 Wd  S(   N(   t   fixed_expectedR*   R   R   (   R   R,   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_fixed_hashh   s    c         C   s+   x$ |  j  D] } |  j t t | ƒ q
 Wd  S(   N(   t   error_expectedt   assertRaisest	   TypeErrorR   (   R   R,   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_error_hashl   s    c         C   s5   |  j  |  j } x | D] } |  j | t ƒ q Wd  S(   N(   R)   R.   t   assertIsInstanceR   (   R   t   objectsR,   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_hashablep   s    
c         C   s(   x! |  j  D] } |  j | t ƒ q
 Wd  S(   N(   R0   t   assertNotIsInstanceR   (   R   R,   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_not_hashablev   s    (   R   R   t   objectR   R   R   R    R)   R   R$   R%   R&   R.   R'   R0   R-   R/   R3   R6   R8   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR(   V   s   				t   DefaultIterSeqc           B   s&   e  Z e d  ƒ Z d „  Z d „  Z RS(   i
   c         C   s   t  |  j ƒ S(   N(   t   lent   seq(   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   __len__€   s    c         C   s   |  j  | S(   N(   R<   (   R   t   index(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   __getitem__‚   s    (   R   R   t   rangeR<   R=   R?   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR:   ~   s   	t   HashBuiltinsTestCasec           B   sJ   e  Z e d  ƒ e e d  ƒ ƒ e e ƒ  ƒ e d „  d ƒ g Z d „  Z RS(   i
   c           C   s   d S(   Ni    (    (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   <lambda>‰   t    i    c         C   s=   t  j } x- |  j D]" } |  j t | ƒ | | ƒ ƒ q Wd  S(   N(   R9   R   t   hashes_to_checkR*   R   (   R   R+   R,   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_hashesŒ   s    	(   R   R   t   xranget	   enumeratet   iterR:   RD   RE   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyRA   …   s
   	t   HashRandomizationTestsc           B   s&   e  Z d  „  Z d d „ Z d „  Z RS(   c         C   s   d | S(   Ns   print(hash(%s))(    (   R   t   repr_(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   get_hash_command–   s    c      
   C   sº   t  j j ƒ  } | d  k	 r. t | ƒ | d <n | j d d  ƒ t j d |  j | ƒ g } t	 j
 | d t	 j d t	 j d t	 j d | ƒ} | j ƒ  \ } } t j | ƒ } t | j ƒ  ƒ S(   Nt   PYTHONHASHSEEDs   -ct   stdint   stdoutt   stderrt   env(   t   ost   environt   copyR   t   strt   popt   syst
   executableRK   t
   subprocesst   Popent   PIPEt   STDOUTt   communicateR    t   strip_python_stderrR   t   strip(   R   RJ   t   seedRP   t   cmd_linet   pt   outt   err(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   get_hash™   s    	c         C   sD   |  j  |  j d d ƒ} |  j  |  j d d ƒ} |  j | | ƒ d  S(   NR_   t   random(   Rd   RJ   t   assertNotEqual(   R   t   run1t   run2(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_randomized_hash§   s    N(   R   R   RK   R   Rd   Ri   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyRI   ‘   s   	t    StringlikeHashRandomizationTestsc           B   s   e  Z d  „  Z d „  Z RS(   c         C   sW   t  r d } n d } |  j |  j |  j ƒ | ƒ |  j |  j |  j d d ƒ| ƒ d  S(   NI£Ð“ P`*i£Ð“ R_   i    (   t   IS_64BITR*   Rd   RJ   (   R   t   known_hash_of_obj(    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_null_hash®   s
    	c         C   sk   t  r' t j d k r d } qE d } n t j d k r? d } n d } |  j |  j |  j d d ƒ| ƒ d  S(   Nt   littleI“"~Ñ[KÉÂIîä Õ›FtÎi�„·ói‡ÇöÂR_   i*   (   Rk   RV   t	   byteorderR*   Rd   RJ   (   R   R
   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR/   »   s    			(   R   R   Rm   R/   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyRj   ­   s   	t   StrHashRandomizationTestsc           B   s   e  Z e d  ƒ Z d „  Z RS(   t   abcc         C   s   |  j  t d ƒ d ƒ d  S(   NRC   i    (   R*   R   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   test_empty_stringÍ   s    (   R   R   t   reprRJ   Rr   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyRp   Ê   s   t   UnicodeHashRandomizationTestsc           B   s   e  Z e d  ƒ Z d „  Z RS(   u   abcc         C   s   |  j  t d ƒ d ƒ d  S(   Nu    i    (   R*   R   (   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyRr   Ó   s    (   R   R   Rs   RJ   Rr   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyRt   Ð   s   t   BufferHashRandomizationTestsc           B   s   e  Z d  Z d „  Z RS(   s   buffer("abc")c         C   s3   t  j ƒ  �! |  j t t d ƒ ƒ d ƒ Wd  QXd  S(   NRC   i    (   R    t   check_py3k_warningsR*   R   t   buffer(   R   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyRr   Ù   s    (   R   R   RJ   Rr   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyRu   Ö   s   t   DatetimeTestsc           B   s   e  Z d  „  Z RS(   c         C   s   d | S(   Ns    import datetime; print(hash(%s))(    (   R   RJ   (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyRK   Þ   s    (   R   R   RK   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyRx   Ý   s   t   DatetimeDateTestsc           B   s#   e  Z e e j d  d d ƒ ƒ Z RS(   i*  i
   i   (   R   R   Rs   t   datetimet   dateRJ   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyRy   á   s   t   DatetimeDatetimeTestsc        	   B   s/   e  Z e e j d  d d d d d d ƒ ƒ Z RS(   i   i   i   i   i   i   i   (   R   R   Rs   Rz   RJ   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR|   ä   s   t   DatetimeTimeTestsc           B   s   e  Z e e j d  ƒ ƒ Z RS(   i    (   R   R   Rs   Rz   t   timeRJ   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyR}   ç   s   c        
   C   s)   t  j t t t t t t t t	 t
 ƒ	 d  S(   N(   R    t   run_unittestR   R(   RA   Rp   Rt   Ru   Ry   R|   R}   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt	   test_mainë   s    	t   __main__()   RQ   RV   t   structRz   t   unittestRX   t   testR    t   collectionsR   t   calcsizeRk   t   TestCaseR   R9   R   R+   R   R   R   R   R   R    R$   R%   R&   R'   R(   R:   RA   RI   Rj   Rp   Rt   Ru   Rx   Ry   R|   R}   R€   R   (    (    (    s„   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hash.pyt   <module>   sJ   "	(	