ó
wÛjc           @   sĤ   d  Z  d d l Z d d l m Z m Z e d d e Z d d l Z d d l Z d d l	 Z	 d d l
 Z
 d e j f d     YZ d   Z e d	 k r˘ e   n  d S(
   s7   
  Test cases for the dircache module
  Nick Mathewson
i˙˙˙˙N(   t   run_unittestt   import_modulet   dircachet
   deprecatedt   DircacheTestsc           B   sG   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   c         C   s   t  j   |  _ d  S(   N(   t   tempfilet   mkdtempt   tempdir(   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_dircache.pyt   setUp   s    c         C   s>   x' t  j |  j  D] } |  j |  q Wt  j |  j  d  S(   N(   t   ost   listdirR   t   delTempt   rmdir(   R   t   fname(    (    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_dircache.pyt   tearDown   s    c         C   s/   t  t j j |  j |  d  } | j   d  S(   Nt   w(   t   openR
   t   patht   joinR   t   close(   R   R   t   f(    (    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_dircache.pyt	   writeTemp   s    !c         C   s#   t  j t  j j |  j |   d  S(   N(   R
   t   mkdirR   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_dircache.pyt	   mkdirTemp   s    c         C   sK   t  j j |  j |  } t  j j |  r: t  j |  n t  j |  d  S(   N(   R
   R   R   R   t   isdirR   t   unlink(   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_dircache.pyR      s    c         C   sÖ   t  j |  j  } |  j | g   |  j t  j |  j  | k  t j d  d k rµ t j d  |  j	 d  t  j |  j  } |  j | d g  |  j t  j |  j  | k  n  |  j
 t t  j |  j d  d  S(   Ni   t   wint   os2i   t   test1t   _nonexistent(   R   R   (   R   R   R   t   assertEqualt
   assertTruet   syst   platformt   timet   sleepR   t   assertRaisest   OSError(   R   t   entries(    (    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_dircache.pyt   test_listdir#   s    "c         C   sY   |  j  d  |  j d  d d d g } t j |  j |  |  j | d d d g  d  S(   Nt   test2t   At   test_nonexistents   A/(   R   R   R   t   annotateR   R   (   R   t   lst(    (    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_dircache.pyt   test_annotate=   s
    (	   t   __name__t
   __module__R	   R   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_dircache.pyR      s   						c           C   s    z t  t  Wd  t j   Xd  S(   N(   R    R   R   t   reset(    (    (    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_dircache.pyt	   test_mainE   s    t   __main__(   t   __doc__t   unittestt   test.test_supportR    R   t   TrueR   R
   R#   R!   R   t   TestCaseR   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_dircache.pyt   <module>   s   09	