mò
­fIc           @   s  d  k  Z  d k l Z d  k Z d f  d „  ƒ  YZ d f  d „  ƒ  YZ h  d d „  e i e i f <d d	 „  e i e i	 f <d
 d „  e i
 e i f <d d „  e i e i f <d d „  e i e i f <d d „  e i e i f <Z d e  i f d „  ƒ  YZ d e  i f d „  ƒ  YZ d e  i f d „  ƒ  YZ d e  i f d „  ƒ  YZ d e  i f d „  ƒ  YZ d „  Z e d j o e ƒ  n d  S(   N(   s   test_supportt   Numberc           B   sY   t  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d	 „  Z
 RS(
   Nc         C   s   | |  _  d  S(   N(   t   xt   self(   R   R   (    (    t.   /mit/python/lib/python2.4/test/test_richcmp.pyt   __init__
   s    c         C   s   |  i | j  S(   N(   R   R   t   other(   R   R   (    (    R   t   __lt__   s    c         C   s   |  i | j S(   N(   R   R   R   (   R   R   (    (    R   t   __le__   s    c         C   s   |  i | j S(   N(   R   R   R   (   R   R   (    (    R   t   __eq__   s    c         C   s   |  i | j S(   N(   R   R   R   (   R   R   (    (    R   t   __ne__   s    c         C   s   |  i | j S(   N(   R   R   R   (   R   R   (    (    R   t   __gt__   s    c         C   s   |  i | j S(   N(   R   R   R   (   R   R   (    (    R   t   __ge__   s    c         C   s   t  i d ‚ d  S(   Ns%   Number.__cmp__() should not be called(   t   test_supportt
   TestFailed(   R   R   (    (    R   t   __cmp__   s    c         C   s   d |  i f S(   Ns
   Number(%r)(   R   R   (   R   (    (    R   t   __repr__"   s    (   t   __name__t
   __module__R   R   R   R   R	   R
   R   R   R   (    (    (    R   R       s   								t   Vectorc           B   s   t  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(   Nc         C   s   | |  _  d  S(   N(   t   dataR   (   R   R   (    (    R   R   '   s    c         C   s   t  |  i ƒ S(   N(   t   lenR   R   (   R   (    (    R   t   __len__*   s    c         C   s   |  i | S(   N(   R   R   t   i(   R   R   (    (    R   t   __getitem__-   s    c         C   s   | |  i | <d  S(   N(   t   vR   R   R   (   R   R   R   (    (    R   t   __setitem__0   s    c         C   s   t  d ‚ d  S(   Ns   Vectors cannot be hashed(   t	   TypeError(   R   (    (    R   t   __hash__3   s    c         C   s   t  d ‚ d  S(   Ns*   Vectors cannot be used in Boolean contexts(   R   (   R   (    (    R   t   __nonzero__6   s    c         C   s   t  i d ‚ d  S(   Ns%   Vector.__cmp__() should not be called(   R   R   (   R   R   (    (    R   R   9   s    c         C   s   d |  i f S(   Ns
   Vector(%r)(   R   R   (   R   (    (    R   R   <   s    c         C   sF   t  g  } t |  i |  i | ƒ ƒ D] \ } } | | | j  q# ~ ƒ S(   N(	   R   t   _[1]t   zipR   R   t   _Vector__castR   t   at   b(   R   R   R    R!   R   (    (    R   R   ?   s    c         C   sF   t  g  } t |  i |  i | ƒ ƒ D] \ } } | | | j q# ~ ƒ S(   N(	   R   R   R   R   R   R   R   R    R!   (   R   R   R    R!   R   (    (    R   R   B   s    c         C   sF   t  g  } t |  i |  i | ƒ ƒ D] \ } } | | | j q# ~ ƒ S(   N(	   R   R   R   R   R   R   R   R    R!   (   R   R   R    R!   R   (    (    R   R   E   s    c         C   sF   t  g  } t |  i |  i | ƒ ƒ D] \ } } | | | j q# ~ ƒ S(   N(	   R   R   R   R   R   R   R   R    R!   (   R   R   R    R!   R   (    (    R   R	   H   s    c         C   sF   t  g  } t |  i |  i | ƒ ƒ D] \ } } | | | j q# ~ ƒ S(   N(	   R   R   R   R   R   R   R   R    R!   (   R   R   R    R!   R   (    (    R   R
   K   s    c         C   sF   t  g  } t |  i |  i | ƒ ƒ D] \ } } | | | j q# ~ ƒ S(   N(	   R   R   R   R   R   R   R   R    R!   (   R   R   R    R!   R   (    (    R   R   N   s    c         C   sJ   t  | t ƒ o | i } n t |  i ƒ t | ƒ j o t d ‚ n | S(   Ns*   Cannot compare vectors of different length(   t
   isinstanceR   R   R   R   R   t
   ValueError(   R   R   (    (    R   t   __castQ   s
    (   R   R   R   R   R   R   R   R   R   R   R   R   R   R	   R
   R   R   (    (    (    R   R   %   s   														t   ltc         C   s
   |  | j  S(   N(   R    R!   (   R    R!   (    (    R   t   <lambda>Y   s    t   lec         C   s
   |  | j S(   N(   R    R!   (   R    R!   (    (    R   R&   Z   s    t   eqc         C   s
   |  | j S(   N(   R    R!   (   R    R!   (    (    R   R&   [   s    t   nec         C   s
   |  | j S(   N(   R    R!   (   R    R!   (    (    R   R&   \   s    t   gtc         C   s
   |  | j S(   N(   R    R!   (   R    R!   (    (    R   R&   ]   s    t   gec         C   s
   |  | j S(   N(   R    R!   (   R    R!   (    (    R   R&   ^   s    t
   VectorTestc           B   s#   t  Z d „  Z d „  Z d „  Z RS(   Nc         G   s,   x% t  | D] } |  i | | | Œ q Wd  S(   N(   t   opmapt   opnamet   opR   t   assertRaisest   errort   args(   R   R1   R.   R2   R/   (    (    R   t	   checkfailc   s     c         C   s|   xu t  | D]i } | | | ƒ } |  i t | ƒ t | ƒ ƒ x5 t
 t | ƒ ƒ D]! } |  i | | | | j ƒ qO Wq Wd  S(   N(   R-   R.   R/   R    R!   t   realresR   t   assertEqualR   t   exprest   xrangeR   t   assert_(   R   R.   R    R!   R6   R   R4   R/   (    (    R   t
   checkequalg   s      c      
   C   sÚ  t  t d ƒ ƒ } t  t d ƒ ƒ } x$ t D] } |  i t | | | ƒ q+ Wt d ƒ } d d g } | t  | ƒ f t  | ƒ | f t  | ƒ t  | ƒ f g } x6| D].\ } } |  i
 d | | t t t t t g ƒ |  i
 d | | t t t t t g ƒ |  i
 d | | t t t t t g ƒ |  i
 d | | t t t t t g ƒ |  i
 d | | t t t t t g ƒ |  i
 d	 | | t t t t t g ƒ xA t i ƒ  D]3 } x* | D]" } |  i t t | | | ƒ ƒ q¨Wq›Wq¤ Wd  S(
   Ni   i   i   R%   R'   R(   R)   R*   R+   (   R   t   rangeR    R!   R-   R.   R   R3   R#   R2   R9   t   Truet   Falset
   itervaluest   opsR/   R0   R   t   bool(   R   R    R!   R>   R2   R.   R/   (    (    R   t
   test_mixedp   s*     9 %%%%%%  (   R   R   R3   R9   R@   (    (    (    R   R,   a   s   			t
   NumberTestc           B   s#   t  Z d „  Z d „  Z d „  Z RS(   Nc      	   C   só   xì t  d ƒ D]Þ } xÕ t  d ƒ D]Ç } x¾ t t f D]° } x§ t t f D]™ } | | j o
 t j n o qF n | | ƒ }
 | | ƒ }	 xS t	 i
 ƒ  D]E } x< | D]4 } | | | ƒ } | |
 |	 ƒ } |  i | | ƒ q£ Wq– WqF Wq3 Wq  Wq Wd  S(   Ni   (   R7   R    R!   t   intR    t   typeat   typebt   tat   tbR-   R=   R>   R/   t   realoutcomet   testoutcomeR   R5   (   R   R    R!   R>   RC   RD   RG   RH   R/   RF   RE   (    (    R   t
   test_basic   s&          c         C   s“   xŒ t  t f D]~ } xu t  t f D]g } | | ƒ }
 | | ƒ }	 xF t | D]: } | |
 |	 ƒ } t | d | ƒ } |  i | | j ƒ qI Wq  Wq Wd  S(   NR   (   RB   R    RC   RD   R    RE   R!   RF   R-   R.   R/   R4   t   getattrR   R8   R6   (   R   R.   R    R!   R6   R4   RC   RD   R/   RF   RE   (    (    R   t
   checkvalueŸ   s       c         C   s  |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ |  i d d d t ƒ d  S(	   NR%   i    R'   R(   R)   R*   R+   i   (   R   RK   R<   R;   (   R   (    (    R   t   test_values©   s$    (   R   R   RI   RK   RL   (    (    (    R   RA   ‹   s   		
t   MiscTestc           B   s#   t  Z d „  Z d „  Z d „  Z RS(   Nc         C   s   d f  d „  ƒ  Y} | ƒ  } | ƒ  } |  i | | j  d ƒ |  i | | j d ƒ |  i | | j d ƒ |  i t t | | ƒ d  S(   Nt   Misbc           B   sG   t  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   Nc         C   s   d S(   Ni    (    (   R   R   (    (    R   R   Ä   s    c         C   s   d S(   Ni    (    (   R   R   (    (    R   R
   Å   s    c         C   s   d S(   Ni    (    (   R   R   (    (    R   R   Æ   s    c         C   s   t  d ‚ d  S(   Ns   This shouldn't happen(   R   (   R   R   (    (    R   R   Ç   s    c         C   s   t  d ‚ d  S(   Ns   This shouldn't happen(   R   (   R   R   (    (    R   R   È   s    c         C   s   t  d ‚ d  S(   Ns   This shouldn't happen(   R   (   R   R   (    (    R   R	   É   s    c         C   s   t  d ‚ d  S(   Nt   expected(   t   RuntimeError(   R   R   (    (    R   R   Ê   s    (	   R   R   R   R
   R   R   R   R	   R   (    (    (    R   RN   Ã   s   						i    (   RN   R    R!   R   R5   R0   RP   t   cmp(   R   R    R!   RN   (    (    R   t   test_misbehavinÂ   s    		c            so   d  k  } d f  d „  ƒ  Y‰  d f  ‡  d †  ƒ  Y} d „  } x- | | i f D] } |  i ˆ  | | ƒ  ƒ qK Wd  S(   Nt   Excc           B   s   t  Z RS(   N(   R   R   (    (    (    R   RS   Ö   s   t   Badc              s   t  Z ‡  d †  Z RS(   Nc            s
   ˆ  ‚ d  S(   N(   RS   (   R   (   RS   (    R   R   Ù   s    (   R   R   R   (    (   RS   (    R   RT   Ø   s   c         C   s	   |  d  S(   N(   t   bad(   RU   (    (    R   t   doÜ   s    (   t   operatorRS   RT   RV   t   not_t   funcR   R0   (   R   RV   RS   RT   RY   RW   (    (   RS   R   t   test_notÒ   s    		 c         C   s  d k  l  } | ƒ  } | ƒ  } | i | ƒ | i | ƒ |  i t t i | | ƒ |  i t t i	 | | ƒ |  i t t i
 | | ƒ |  i t t i | | ƒ |  i t t i | | ƒ |  i t t i | | ƒ | i d ƒ |  i | | j ƒ |  i | | j ƒ |  i t t i
 | | ƒ |  i t t i | | ƒ |  i t t i | | ƒ |  i t t i | | ƒ | i d ƒ |  i t t i | | ƒ |  i t t i	 | | ƒ | i d d ƒ | i d d ƒ |  i | | j ƒ |  i | | j ƒ |  i | | j  ƒ d  S(   N(   s   UserListi   i    i   i   (   t   UserListR    R!   t   appendR   R0   RP   RW   R(   R)   R%   R'   R*   R+   R8   t   insert(   R   R    R!   R[   (    (    R   t   test_recursionâ   s4    		(   R   R   RR   RZ   R^   (    (    (    R   RM   À   s   		t   DictTestc           B   s   t  Z d „  Z RS(   Nc         C   s0  d  k  } h  } x8 t d ƒ D]* } | i d ƒ d | | i d ƒ d <q W| i ƒ  } | i | ƒ h  } x | D] \ }	 } | | |	 <qp W| i
 ƒ  } | d | |	 <|  i | | j ƒ |  i | | j ƒ |  i | | j ƒ |  i | | j ƒ x9 d	 D]1 } x( t | D] }
 |  i t |
 | | ƒ qWq÷ Wd  S(
   Ni2   id   x0.01.0f1.0R%   R'   R*   R+   (   s   lts   les   gts   ge(   t   randomt   imag1aR:   R   t	   randranget   itemst   shufflet   imag1bt   kR   t   copyt   imag2R   R8   R.   R-   R/   R0   R   (   R   R   Rc   R`   Rh   Re   Ra   R   R.   Rf   R/   (    (    R   t
   test_dicts  s,    	 (   (   R   R   Ri   (    (    (    R   R_     s   t   ListTestc           B   s,   t  Z d „  Z d „  Z d „  Z d „  Z RS(   Nc         C   s   |  i | | j ƒ d  S(   N(   R   R8   R    R!   (   R   R    R!   (    (    R   t   assertIs  s    c         C   s!  d g } |  i | | j  t ƒ |  i | | j t ƒ |  i | | j t ƒ |  i | | j t ƒ |  i | | j t ƒ |  i | | j t ƒ d d g } |  i | | j  t ƒ |  i | | j t ƒ |  i | | j t ƒ |  i | | j t ƒ |  i | | j t ƒ |  i | | j t ƒ d  S(   Ni*   (   R   R   Rk   R<   R;   t   y(   R   Rl   R   (    (    R   t   test_coverage   s    	c            sp   d f  d „  ƒ  Y‰  d f  ‡  d †  ƒ  Y} | ƒ  g } | ƒ  g } x( t d D] } |  i ˆ  | | | ƒ qL Wd  S(   NRS   c           B   s   t  Z RS(   N(   R   R   (    (    (    R   RS   4  s   RT   c              s   t  Z ‡  d †  Z RS(   Nc            s
   ˆ  ‚ d  S(   N(   RS   (   R   R   (   RS   (    R   R   7  s    (   R   R   R   (    (   RS   (    R   RT   6  s   R(   (   RS   RT   R   Rl   R-   R/   R   R0   (   R   RS   RT   Rl   R   R/   (    (   RS   R   t   test_badentry1  s     c         C   s]   d f  d „  ƒ  Y} | ƒ  g } | ƒ  g } x+ t d D] } |  i | | | ƒ t ƒ q6 Wd  S(   Nt   Goodc           B   s   t  Z d „  Z RS(   Nc         C   s   t  S(   N(   R;   (   R   R   (    (    R   R   D  s    (   R   R   R   (    (    (    R   Ro   C  s   R%   (   Ro   R   Rl   R-   R/   R   Rk   R;   (   R   Ro   Rl   R   R/   (    (    R   t   test_goodentry@  s     (   R   R   Rk   Rm   Rn   Rp   (    (    (    R   Rj     s   			c           C   s   t  i t t t t t ƒ d  S(   N(   R   t   run_unittestR,   RA   RM   R_   Rj   (    (    (    R   t	   test_mainM  s    t   __main__(   t   unittestt   testR   RW   R    R   R%   R   R'   R   R(   R   R)   R	   R*   R
   R+   R   R-   t   TestCaseR,   RA   RM   R_   Rj   Rr   R   (   R   R,   R_   RA   Rt   RM   R    R-   R   Rr   RW   Rj   (    (    R   t   ?   s   		3¨	*5B2	