ó
¬«Y]c           @   sg   d  d l  m Z d  d l Z e j d ƒ Z d e j f d „  ƒ  YZ d „  Z e d k rc e ƒ  n  d S(   iÿÿÿÿ(   t   test_supportNt   dbmt   DbmTestCasec           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s5   t  j |  _ t j |  j d ƒ |  _ |  j j ƒ  d  S(   Nt   c(   R    t   TESTFNt   filenameR   t   opent   dt   close(   t   self(    (    s   lib/python2.7/test/test_dbm.pyt   setUp   s    c         C   s5   x. d d d d g D] } t  j |  j | ƒ q Wd  S(   Nt    s   .pags   .dirs   .db(   R    t   unlinkR   (   R	   t   suffix(    (    s   lib/python2.7/test/test_dbm.pyt   tearDown   s    c            s  t  j ˆ  j d ƒ ˆ  _ ˆ  j ˆ  j j ƒ  g  ƒ d	 d
 g } x! | D] \ } } | ˆ  j | <qD Wˆ  j t ˆ  j j ƒ  ƒ t d „  | Dƒ ƒ ƒ x> | D]6 \ } } ˆ  j | ˆ  j ƒ ˆ  j ˆ  j | | ƒ q— Wˆ  j d ˆ  j ƒ ˆ  j	 t
 ‡  f d †  ƒ ˆ  j j ƒ  d  S(   NR   t   at   bt   12345678910t   019237410982340912840198242c         s   s   |  ] \ } } | Vq d  S(   N(    (   t   .0t   kt   v(    (    s   lib/python2.7/test/test_dbm.pys	   <genexpr>   s    t   xxxc              s   ˆ  j  d S(   NR   (   R   (    (   R	   (    s   lib/python2.7/test/test_dbm.pyt   <lambda>   R   (   R   R   (   R   R   (   R   R   R   R   t   assertEqualt   keyst   sortedt   assertInt   assertNotInt   assertRaisest   KeyErrorR   (   R	   R   R   R   (    (   R	   s   lib/python2.7/test/test_dbm.pyt	   test_keys   s    /c         C   sk   xd d d d d g D]P } y) t  j |  j | ƒ |  _ |  j j ƒ  Wq t  j k
 rb |  j ƒ  q Xq Wd  S(   Nt   rt   rwt   wt   n(   R   R   R   R   R   t   errort   fail(   R	   t   mode(    (    s   lib/python2.7/test/test_dbm.pyt
   test_modes   s    (   t   __name__t
   __module__R
   R   R   R'   (    (    (    s   lib/python2.7/test/test_dbm.pyR      s   			c           C   s   t  j t ƒ d  S(   N(   R    t   run_unittestR   (    (    (    s   lib/python2.7/test/test_dbm.pyt	   test_main&   s    t   __main__(	   t   testR    t   unittestt   import_moduleR   t   TestCaseR   R+   R(   (    (    (    s   lib/python2.7/test/test_dbm.pyt   <module>   s   !	