ó
¬«Y]c           @   sd   d  d l  Z  d  d l m Z d  d l Z d e  j f d „  ƒ  YZ d „  Z e d k r` e ƒ  n  d S(   iÿÿÿÿN(   t   test_supportt   BoolTestc           B   sò   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   sX   y d t  f d „  ƒ  Y} Wn t k
 r- n X|  j d ƒ |  j t t j t  d ƒ d  S(   Nt   Cc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s   lib/python2.7/test/test_bool.pyR      s   s   bool should not be subclassablei    (   t   boolt	   TypeErrort   failt   assertRaisest   intt   __new__(   t   selfR   (    (    s   lib/python2.7/test/test_bool.pyt   test_subclass
   s    c         C   sz   zX t  t j d ƒ } | t It IJ| j ƒ  t  t j d ƒ } |  j | j ƒ  d ƒ Wd  | j ƒ  t j	 t j ƒ Xd  S(   Nt   wbt   rbs   False True
(
   t   openR    t   TESTFNt   Falset   Truet   closet   assertEqualt   readt   ost   remove(   R   t   fo(    (    s   lib/python2.7/test/test_bool.pyt
   test_print   s    

c         C   sh   |  j  t t ƒ d ƒ |  j  t t ƒ d ƒ |  j  t t t ƒ ƒ t ƒ |  j  t t t ƒ ƒ t ƒ d  S(   NR   R   (   R   t   reprR   R   t   eval(   R   (    (    s   lib/python2.7/test/test_bool.pyt	   test_repr    s    c         C   s0   |  j  t t ƒ d ƒ |  j  t t ƒ d ƒ d  S(   NR   R   (   R   t   strR   R   (   R   (    (    s   lib/python2.7/test/test_bool.pyt   test_str&   s    c         C   s\   |  j  t t ƒ d ƒ |  j t t ƒ t ƒ |  j  t t ƒ d ƒ |  j t t ƒ t ƒ d  S(   Ni    i   (   R   R	   R   t   assertIsNotR   (   R   (    (    s   lib/python2.7/test/test_bool.pyt   test_int*   s    c         C   s\   |  j  t t ƒ d ƒ |  j t t ƒ t ƒ |  j  t t ƒ d ƒ |  j t t ƒ t ƒ d  S(   Ng        g      ð?(   R   t   floatR   R   R   (   R   (    (    s   lib/python2.7/test/test_bool.pyt
   test_float0   s    c         C   s\   |  j  t t ƒ d ƒ |  j t t ƒ t ƒ |  j  t t ƒ d ƒ |  j t t ƒ t ƒ d  S(   Nl    l    (   R   t   longR   R   R   (   R   (    (    s   lib/python2.7/test/test_bool.pyt	   test_long6   s    c         C   sc  |  j  t 
d ƒ |  j t 
t ƒ |  j  t d ƒ |  j t t ƒ |  j  t t ƒ d ƒ |  j t t ƒ t ƒ |  j  t 
d ƒ |  j t 
t ƒ |  j  t d ƒ |  j  t t ƒ d ƒ |  j t t ƒ t ƒ |  j  t d ƒ |  j  t d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  d t d ƒ |  j  d t d ƒ |  j  t t d ƒ |  j t t t ƒ |  j  t t d ƒ |  j t t t ƒ |  j  t t d ƒ |  j t t t ƒ |  j  t t d ƒ |  j  t t d ƒ |  j t t t ƒ |  j  t t d ƒ |  j t t t ƒ |  j  t t d ƒ |  j t t t ƒ |  j  t t d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j t d t ƒ |  j  t d d ƒ |  j t d t ƒ |  j  t d d ƒ |  j t d t ƒ xg t t f D]Y } xP d D]H } |  j  | | t | ƒ | ƒ |  j | | t t | ƒ | ƒ ƒ qÿWqòWxÅt t f D]·} x®t t f D] } |  j | | @t t | ƒ t | ƒ @ƒ ƒ |  j | | Bt t | ƒ t | ƒ Bƒ ƒ |  j | | At t | ƒ t | ƒ Aƒ ƒ |  j  | t | ƒ @t | ƒ t | ƒ @ƒ |  j | t | ƒ @t t | ƒ t | ƒ @ƒ ƒ |  j  | t | ƒ Bt | ƒ t | ƒ Bƒ |  j | t | ƒ Bt t | ƒ t | ƒ Bƒ ƒ |  j  | t | ƒ At | ƒ t | ƒ Aƒ |  j | t | ƒ At t | ƒ t | ƒ Aƒ ƒ |  j  t | ƒ | @t | ƒ t | ƒ @ƒ |  j t | ƒ | @t t | ƒ t | ƒ @ƒ ƒ |  j  t | ƒ | Bt | ƒ t | ƒ Bƒ |  j t | ƒ | Bt t | ƒ t | ƒ Bƒ ƒ |  j  t | ƒ | At | ƒ t | ƒ Aƒ |  j t | ƒ | At t | ƒ t | ƒ Aƒ ƒ qoWq\W|  j d d k t ƒ |  j d d k t ƒ |  j d d k  t ƒ |  j d d k  t ƒ |  j d d k t ƒ |  j d d k t ƒ |  j d d k t ƒ |  j d d k t ƒ |  j d d k t ƒ |  j d d k t ƒ |  j d d k t ƒ |  j d d k t ƒ d g } |  j | | k t ƒ |  j | | k	 t ƒ |  j d | k t ƒ |  j d | k t ƒ |  j d | k t ƒ |  j d | k t ƒ i d d 6} |  j | | k t ƒ |  j | | k	 t ƒ |  j d | k t ƒ |  j d | k t ƒ |  j d | k t ƒ |  j d | k t ƒ |  j t t ƒ |  j t t ƒ d  S(   Ni    i   iÿÿÿÿiþÿÿÿi   i   (   i    i   i   (   R   R   R   t   absR   R	   R   t   assertIs(   R   t   bt   it   at   x(    (    s   lib/python2.7/test/test_bool.pyt	   test_math<   s®    ,****0*0*0*0*0*8	c         C   s±   |  j  t t d d ƒ |  j t d ƒ t ƒ |  j t d ƒ t ƒ |  j t d ƒ t ƒ |  j t d ƒ t ƒ |  j t d ƒ t ƒ |  j t d ƒ t ƒ |  j t ƒ  t ƒ d  S(   Ni*   i
   i   iÿÿÿÿi    t   hellot    (   R   R   R   R&   R   R   (   R   (    (    s   lib/python2.7/test/test_bool.pyt   test_convert¢   s    c         C   sT   |  j  d t d ƒ |  j  d t d ƒ |  j  d t d ƒ |  j  d t d ƒ d  S(   Ns   %dt   0t   1s   %x(   R   R   R   (   R   (    (    s   lib/python2.7/test/test_bool.pyt   test_format¬   s    c         C   s6   |  j  t g  d ƒ t ƒ |  j  t g  d ƒ t ƒ d  S(   Nt   appendt   wobble(   R&   t   hasattrR   R   (   R   (    (    s   lib/python2.7/test/test_bool.pyt   test_hasattr²   s    c         C   s0   |  j  t t ƒ t ƒ |  j  t d ƒ t ƒ d  S(   Ni   (   R&   t   callablet   lenR   R   (   R   (    (    s   lib/python2.7/test/test_bool.pyt   test_callable¶   s    c         C   sš   |  j  t t t ƒ t ƒ |  j  t t t ƒ t ƒ |  j  t t t ƒ t ƒ |  j  t t t ƒ t ƒ |  j  t d t ƒ t ƒ |  j  t d t ƒ t ƒ d  S(   Ni   i    (   R&   t
   isinstanceR   R   R   R	   (   R   (    (    s   lib/python2.7/test/test_bool.pyt   test_isinstanceº   s    c         C   s6   |  j  t t t ƒ t ƒ |  j  t t t ƒ t ƒ d  S(   N(   R&   t
   issubclassR   R	   R   R   (   R   (    (    s   lib/python2.7/test/test_bool.pyt   test_issubclassÂ   s    c         C   sƒ   |  j  d i  k t ƒ |  j  d i d d 6k t ƒ t j ƒ  > |  j  i  j d ƒ t ƒ |  j  i d d 6j d ƒ t ƒ Wd  QXd  S(   Ni   (   R&   R   R   R    t   check_py3k_warningst   has_key(   R   (    (    s   lib/python2.7/test/test_bool.pyt   test_haskeyÆ   s
    c         C   s‚  |  j  d j d ƒ t ƒ |  j  d j d ƒ t ƒ |  j  d j ƒ  t ƒ |  j  d j ƒ  t ƒ |  j  d j ƒ  t ƒ |  j  d j ƒ  t ƒ |  j  d j ƒ  t ƒ |  j  d j ƒ  t ƒ |  j  d j ƒ  t ƒ |  j  d j ƒ  t ƒ |  j  d j ƒ  t ƒ |  j  d j ƒ  t ƒ |  j  d	 j	 ƒ  t ƒ |  j  d j	 ƒ  t ƒ |  j  d j
 ƒ  t ƒ |  j  d j
 ƒ  t ƒ |  j  d j d ƒ t ƒ |  j  d j d ƒ t ƒ t j r~|  j  t d d
 ƒ j t d d
 ƒ ƒ t ƒ |  j  t d d
 ƒ j t d d
 ƒ ƒ t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d d
 ƒ j ƒ  t ƒ |  j  t d	 d
 ƒ j	 ƒ  t ƒ |  j  t d d
 ƒ j	 ƒ  t ƒ |  j  t d d
 ƒ j
 ƒ  t ƒ |  j  t d d
 ƒ j
 ƒ  t ƒ |  j  t d d
 ƒ j t d d
 ƒ ƒ t ƒ |  j  t d d
 ƒ j t d d
 ƒ ƒ t ƒ n  d  S(   Nt   xyzt   zR*   t   xyz0123s   @#$%t   0123t   XYZt    t   Xt   ascii(   R&   t   endswithR   R   t   isalnumt   isalphat   isdigitt   islowert   isspacet   istitlet   isuppert
   startswithR    t   have_unicodet   unicodet	   isdecimalt	   isnumeric(   R   (    (    s   lib/python2.7/test/test_bool.pyt   test_stringÍ   sR    	+++c         C   s¸   |  j  t d @d ƒ |  j t d @t ƒ |  j t t @t ƒ |  j  t d Bd ƒ |  j t d Bt ƒ |  j t t Bt ƒ |  j  t d Ad ƒ |  j t d At ƒ |  j t t At ƒ d  S(   Ni   i    (   R   R   t   assertNotIsInstanceR   R&   R   (   R   (    (    s   lib/python2.7/test/test_bool.pyt   test_booleanù   s    c         C   s^   zF t  t j d ƒ } |  j | j t ƒ | j ƒ  |  j | j t ƒ Wd  t j	 t j ƒ Xd  S(   Nt   w(
   t   fileR    R   R&   t   closedR   R   R   R   R   (   R   t   f(    (    s   lib/python2.7/test/test_bool.pyt   test_fileclosed  s    
c         C   sR   xK t  t t t t t t t t t	 t
 t t g D] } |  j t  | ƒ t ƒ q. Wd  S(   N(   R   t   complext   dictRY   R!   R	   t   listR#   t   objectt   setR   t   tuplet   typeR&   R   (   R   t   t(    (    s   lib/python2.7/test/test_bool.pyt
   test_types  s    c         C   s2  d d  l  } |  j | j d ƒ t ƒ |  j | j d ƒ t ƒ t j ƒ  7 |  j | j d ƒ t ƒ |  j | j t ƒ t ƒ Wd  QX|  j | j	 d  ƒ t ƒ |  j | j	 d ƒ t ƒ |  j | j d ƒ t ƒ |  j | j d ƒ t ƒ |  j | j d ƒ t ƒ |  j | j g  ƒ t ƒ |  j | j g  d ƒ t ƒ |  j | j d g d ƒ t ƒ |  j | j d ƒ t ƒ |  j | j i  ƒ t ƒ |  j | j d d ƒ t ƒ |  j | j d d ƒ t ƒ |  j | j t t ƒ t ƒ |  j | j t t ƒ t ƒ |  j | j t t ƒ t ƒ |  j | j t t ƒ t ƒ d  S(   Niÿÿÿÿi    i   (   t   operatorR&   t   truthR   R   R    R=   t
   isCallableR7   t   isNumberTypet   Nonet   not_t   isSequenceTypet   containst   isMappingTypet   ltt   is_t   is_not(   R   Rf   (    (    s   lib/python2.7/test/test_bool.pyt   test_operator  s,    c         C   sT   d d  l  } |  j | j | j t ƒ ƒ t ƒ |  j | j | j t ƒ ƒ t ƒ d  S(   Niÿÿÿÿ(   t   marshalR&   t   loadst   dumpsR   R   (   R   Rs   (    (    s   lib/python2.7/test/test_bool.pyt   test_marshal-  s    "c         C   sx   d d  l  } xe t | j d ƒ D]P } |  j | j | j t | ƒ ƒ t ƒ |  j | j | j t | ƒ ƒ t ƒ q  Wd  S(   Niÿÿÿÿi   (   t   picklet   ranget   HIGHEST_PROTOCOLR&   Rt   Ru   R   R   (   R   Rw   t   proto(    (    s   lib/python2.7/test/test_bool.pyt   test_pickle2  s    %c         C   sx   d d  l  } xe t | j d ƒ D]P } |  j | j | j t | ƒ ƒ t ƒ |  j | j | j t | ƒ ƒ t ƒ q  Wd  S(   Niÿÿÿÿi   (   t   cPickleRx   Ry   R&   Rt   Ru   R   R   (   R   R|   Rz   (    (    s   lib/python2.7/test/test_bool.pyt   test_cpickle8  s    %c         C   sÎ   d d  l  } d d  l } x¯ t | j d ƒ D]š } |  j | j | j t | ƒ ƒ t ƒ |  j | j | j t | ƒ ƒ t ƒ |  j | j | j t | ƒ ƒ t ƒ |  j | j | j t | ƒ ƒ t ƒ q, Wd  S(   Niÿÿÿÿi   (	   Rw   R|   Rx   Ry   R&   Rt   Ru   R   R   (   R   Rw   R|   Rz   (    (    s   lib/python2.7/test/test_bool.pyt   test_mixedpickle>  s    %%%c         C   s  d d  l  } d d  l } |  j | j t d d ƒd ƒ |  j | j t d d ƒd ƒ |  j | j t d d ƒd ƒ |  j | j t d d ƒd ƒ |  j | j t d d ƒd ƒ |  j | j t d d ƒd ƒ |  j | j t d d ƒd ƒ |  j | j t d d ƒd ƒ |  j | j t d d ƒd ƒ |  j | j t d d ƒd	 ƒ |  j | j t d d ƒd ƒ |  j | j t d d ƒd	 ƒ d  S(
   Niÿÿÿÿt   protocoli    s   I01
.s   I00
.i   i   s   €ˆ.s   €‰.(   Rw   R|   R   Ru   R   R   (   R   Rw   R|   (    (    s   lib/python2.7/test/test_bool.pyt   test_picklevaluesF  s    c            s|   ‡  f d †  } d t  f d „  ƒ  Y} | | ƒ  ƒ d t  f d „  ƒ  Y} | | ƒ  ƒ d t f d „  ƒ  Y} | | ƒ  ƒ d  S(   Nc            s   ˆ  j  t t |  ƒ S(   N(   R   R   R   (   t   o(   R   (    s   lib/python2.7/test/test_bool.pyt   <lambda>[  R-   t   Fooc           B   s   e  Z d  „  Z RS(   c         S   s   |  S(   N(    (   R   (    (    s   lib/python2.7/test/test_bool.pyt   __nonzero__]  s    (   R   R   R„   (    (    (    s   lib/python2.7/test/test_bool.pyRƒ   \  s   t   Barc           B   s   e  Z d  „  Z RS(   c         S   s   d S(   Nt   Yes(    (   R   (    (    s   lib/python2.7/test/test_bool.pyR„   b  s    (   R   R   R„   (    (    (    s   lib/python2.7/test/test_bool.pyR…   a  s   t   Bazc           B   s   e  Z d  „  Z RS(   c         S   s   |  S(   N(    (   R   (    (    s   lib/python2.7/test/test_bool.pyR„   g  s    (   R   R   R„   (    (    (    s   lib/python2.7/test/test_bool.pyR‡   f  s   (   R`   R	   (   R   t   checkRƒ   R…   R‡   (    (   R   s   lib/python2.7/test/test_bool.pyt   test_convert_to_boolW  s    (   R   R   R   R   R   R   R    R"   R$   R+   R.   R1   R5   R8   R:   R<   R?   RU   RW   R\   Re   Rr   Rv   R{   R}   R~   R€   R‰   (    (    (    s   lib/python2.7/test/test_bool.pyR      s4   								f	
							,										c           C   s   t  j t ƒ d  S(   N(   R    t   run_unittestR   (    (    (    s   lib/python2.7/test/test_bool.pyt	   test_mainl  s    t   __main__(   t   unittestt   testR    R   t   TestCaseR   R‹   R   (    (    (    s   lib/python2.7/test/test_bool.pyt   <module>   s   ÿ e	