ó
wŰjc           @   s   d  d l  Z  d  d l Z d  d l m Z m Z m Z m Z e d  Z e Z d e  j	 f d     YZ
 d   Z e d k r e   n  d S(   i˙˙˙˙N(   t   TESTFNt   run_unittestt   unlinkt   import_modulet   gdbmt   TestGdbmc           B   s>   e  Z d    Z d   Z d   Z d   Z d   Z d   Z RS(   c         C   s   d  |  _ d  S(   N(   t   Nonet   g(   t   self(    (    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_gdbm.pyt   setUp   s    c         C   s-   |  j  d  k	 r |  j  j   n  t t  d  S(   N(   R   R   t   closeR   t   filename(   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_gdbm.pyt   tearDown   s    c            sú   t  j t d    _   j   j j   g   d   j d <d   j d <t   j j    }   j | t d d g     j   j j	 d     j j
   } x9 | rÜ   j | |  | j |    j j |  } q¤ W  j t   f d    d  S(   Nt   ct   bt   at   019237410982340912840198242t   12345678910c              s     j  d S(   Nt   xxx(   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_gdbm.pyt   <lambda>    t    (   R   t   openR   R   t   assertEqualt   keyst   sett	   frozensett
   assertTruet   has_keyt   firstkeyt   assertInt   removet   nextkeyt   assertRaisest   KeyError(   R   t   key_sett   key(    (   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_gdbm.pyt   test_key_methods   s    	c            s~   t  t    j t j t j t d  t j t d    _   j j     j t j   f d      j t j d    d  S(   Nt   rR   c              s     j  d S(   NR   (   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_gdbm.pyR   )   R   c           S   s   t  j t d  j   S(   Nt   rx(   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_gdbm.pyR   +   R   (   R   R   R    R   t   errorR   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_gdbm.pyt   test_error_conditions"   s    
c         C   s´   t  t j  } | t  d  } x6 t |  D]( } t j t |  |  _ |  j j   q, W| t  d  } xE | D]= } x4 | D], } t j t | |  |  _ |  j j   q| Wqo Wd  S(   Nt   fsut   crwn(   R   R   t
   open_flagst   sortedR   R   R   R
   (   R   t   allt   modest   modet   flagst   flag(    (    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_gdbm.pyt
   test_flags-   s    c         C   sŇ   t  j t d  |  _ t j j t  } t | d  } d | |  j d <t j j t  } |  j | |  |  j d =|  j	 t j j t  |  |  j j
   t j j t  } |  j | |  |  j | |  d  S(   NR   i'  t   x(   R   R   R   R   t   ost   patht   getsizet   maxt   assertGreaterR   t
   reorganizet
   assertLesst   assertGreaterEqual(   R   t   size0t
   value_sizet   size1t   size2(    (    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_gdbm.pyt   test_reorganize=   s    
(   t   __name__t
   __module__R	   R   R$   R(   R2   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_gdbm.pyR   	   s   					c           C   s   t  t  d  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_gdbm.pyt	   test_mainS   s    t   __main__(   t   unittestR4   t   test.test_supportR    R   R   R   R   R   t   TestCaseR   RC   RA   (    (    (    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_gdbm.pyt   <module>   s   "J	