ó
3ãWµ{  c           @  sÜ  d  d l  m Z d  d l Z d  d l j j Z d  d l Z d  d l	 Z	 d  d l
 Z
 d  d l Z d  d l Z d  d l m Z d  d l Z e	 j j j d  Z e	 j j j d  Z e	 j j j d  Z e	 j j j d  Z d Z d	   Z d
   Z d e j f d     YZ d f  d     YZ d f  d     YZ d f  d     YZ d   Z  d   Z! d   Z" d   Z# d   Z$ d   Z% d   Z& d   Z' d f  d     YZ( d f  d     YZ) d f  d      YZ* d! f  d"     YZ+ d S(#   iÿÿÿÿ(   t   with_statementN(   t   locals   sys.platform.startswith('java')sF   sys.platform.startswith('java') and getattr(os, '_name', None) == 'nt'sC   not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')s=   sys.platform == 'win32' or getattr(os, '_name', None) == 'nt'g{®Gáz?c           s.     f d   } d   }   j  | | d d S(   Nc            s      j  d  }  t j |   |  S(   Nt   tmpdir(   t   getfuncargvaluet   commont   setuptestfs(   t   path1(   t   request(    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   setup   s    c         S  sú   |  j  } d } | |  } | j } |   } | sà d d i t j |  d 6t j |  d 6d t j   k s~ t j |   r t j |   n d d 6t j |  d 6t j |  d	 6t j |  d
 6} t t j |    n  d  } } } } } d  S(   Nt
   samplefilet    sz   assert %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}()
}t   py10t   py2R   t   py0t   py6t   py4t   py8(
   t   joint   checkt
   @pytest_art	   _safereprt   @py_builtinst   localst   _should_repr_global_namet   AssertionErrort   _format_explanationt   None(   R   t   @py_assert1t   @py_assert3t   @py_assert5t   @py_assert7t   @py_assert9t   @py_format11(    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   teardown   s    	   	 	    t   scopet   session(   t   cached_setup(   R   R   R!   (    (   R   s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   pytest_funcarg__path1   s    	c         C  s    d t  f d     Y} | d  S(   Nt   FakeFSPathClassc           B  s   e  Z d    Z d   Z RS(   c         S  s   | |  _  d  S(   N(   t   _path(   t   selft   path(    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   __init__"   s    c         S  s   |  j  S(   N(   R'   (   R(   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt
   __fspath__$   s    (   t   __name__t
   __module__R*   R+   (    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR&   !   s   	s   this/is/a/fake/path(   t   object(   R   R&   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   pytest_funcarg__fake_fspath_obj    s    t   TestLocalPathc           B  s  e  Z d    Z e d    Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 e d    Z d	   Z d
   Z d   Z e j j d  d    Z d   Z d   Z d   Z d   Z d   Z e j j j d e e f  d    Z e d    Z d   Z  d   Z! d   Z" d   Z# d   Z$ d   Z% d   Z& d   Z' e j j j d e d d   d!    Z( d"   Z) d#   Z* d$   Z+ d%   Z, d&   Z- RS('   c         C  s  | j  } d } | |  } | | k } | st j d | f d | | f  i t j |  d 6d t j   k s t j |  r t j |  n d d 6d t j   k s¶ t j |  rÅ t j |  n d d 6t j |  d 6t j |  d	 6} d i | d 6} t t j |    n  d  } } } } | j  d | j
  } | | k } | st j d | f d | | f  i d t j   k st j |  r€t j |  n d d 6d t j   k sÌt j |  rÛt j |  n d d 6}	 d i |	 d	 6}
 t t j |
    n  d  } | j  d | j
  } | | k } | sùt j d | f d | | f  i d t j   k st j |  rt j |  n d d 6d t j   k s¶t j |  rÅt j |  n d d 6}	 d i |	 d	 6}
 t t j |
    n  d  } d  S(   Nt   .s   ==sJ   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
} == %(py8)sR   R   R   R   R   R   R
   s   assert %(py10)sR   s   ../%ss   %(py0)s == %(py2)st   ps   assert %(py4)ss   ..//%s/(   s   ==(   sJ   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
} == %(py8)ss   assert %(py10)s(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   R   R   t   _call_reprcompareR   R   R   R   R   R   R   t   basename(   R(   R   R   R   R   R   t   @py_format9R    R2   t   @py_format3t   @py_format5(    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_join_normpath)   s.    	     Ã             c         C  s  | j  d  } | j } d } | |  } | j  } d } | |  } | | k }	 |	 r~t j d f |	 f d f | | f  i t j |  d 6t j |  d 6t j |  d 6t j |  d	 6d
 t j   k pÝ t j |  rï t j |  n d
 d 6t j |  d 6t j |  d 6d t j   k p4t j |  rFt j |  n d d 6}
 d d i |
 d 6} t t j	 |    n  t
 } } } }	 } } } | j } d } | | d t } t j } | j } d } | |  } | | k } | rat j d f | f d f | | f  i
 t j |  d 6t j |  d 6t j |  d 6t j |  d 6t j |  d	 6d t j   k pt j |  rt j |  n d d 6t j |  d 6d t j   k pÐt j t  rât j t  n d d 6t j |  d 6d t j   k pt j t  r)t j t  n d d 6} d d i | d 6} t t j	 |    n  t
 } } } } } } } } d  S(    Nt   foos   /bart   bars   ==s   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.dirpath
}(%(py4)s)
} == %(py14)s
{%(py14)s = %(py10)s
{%(py10)s = %(py8)s.join
}(%(py12)s)
}t   py14t   py12R   R   R2   R   R   R   R   R   R
   s   assert %(py16)st   py16t   abssŽ   %(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.dirpath
}(%(py4)s, abs=%(py5)s)
} == %(py17)s
{%(py17)s = %(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py9)s.path
}.local
}(%(py15)s)
}t   py17t   py15t   py13t   py11t   py7t   Truet   py5t   pyt   py9s   assert %(py19)st   py19(   R   t   dirpathR   R3   R   R   R   R   R   R   R   RD   RF   R)   R   (   R(   R   R2   R   R   R   R   t   @py_assert11t   @py_assert13R   t   @py_format15t   @py_format17t   @py_assert6t   @py_assert10t   @py_assert12t   @py_assert14t   @py_assert16t   @py_assert8t   @py_format18t   @py_format20(    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_dirpath_abs_no_abs0   s6    	   	     ù   	   	 	     ÿ A   c         C  s'  t  j j d d  j } t  j j d d  } t | d t | d t   } | j d  } d j d  } | j | d d	 | j	 } d } | |  }	 | |  }
 |
 j
 } |   } |	 | k } | r%t j d
 f | f d f |	 | f  i	 t j |  d 6t j |  d 6t j |
  d 6t j |  d 6d t j   k pMt j |  r_t j |  n d d 6t j |	  d 6t j |  d 6d t j   k p€t j |  r¶t j |  n d d 6d t j   k pÛt j |  rít j |  n d d 6} d d i | d 6} t t j |    n  t } } }	 } }
 } } | j	 } d } | |  }	 | |  }
 |
 j
 } |   } |	 | k } | rìt j d
 f | f d f |	 | f  i	 t j |  d 6t j |  d 6t j |
  d 6t j |  d 6d t j   k pt j |  r&t j |  n d d 6t j |	  d 6t j |  d 6d t j   k pkt j |  r}t j |  n d d 6d t j   k p¢t j |  rŽt j |  n d d 6} d d i | d 6} t t j |    n  t } } }	 } }
 } } t  j j t | j	 d  d  S(   Nt   md5t   hashlibt   shat   sha1t   testhashfilet   hellot   asciit   modet   wbs   ==s«   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.computehash
}(%(py4)s)
} == %(py15)s
{%(py15)s = %(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py8)s(%(py9)s)
}.hexdigest
}()
}R@   RA   RB   R   t   fnR   R   R   t   dataRG   R   R
   s   assert %(py17)sR?   t   asdasd(   RF   t   builtint
   _tryimportRW   t   getattrR   R   t   encodet   writet   computehasht	   hexdigestR   R3   R   R   R   R   R   R   t   testt   raisest
   ValueError(   R(   R   RW   t   libRY   R`   Ra   R   R   R   RO   RP   RQ   R   t   @py_format16RT   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_gethash6   sB    	    	 	   ÿ 1   	    	 	   ÿ 1   c         C  sú   | j  d  j   } | j d  | j   | j } d } | d |  } | } | sä d d i t j |  d 6d t j   k s t j	 |  r¡ t j |  n d d	 6t j |  d
 6t j |  d 6} t
 t j |    n  d  } } } } d  S(   Nt   readonlyi    i   t   existsR
   sR   assert not %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(exists=%(py4)s)
}R   t   readonly_fileR   R   R   (   R   t   ensuret   chmodt   removeR   R   R   R   R   R   R   R   R   (   R(   R   Rr   R   R   R   R   t   @py_format8(    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt!   test_remove_removes_readonly_fileA   s    
	     u  c         C  s	  | j  d  j d d  } | j t d d   | j   | j } d } | d |  } | } | só d d i t j |  d	 6d
 t j	   k s¡ t j
 |  r° t j |  n d
 d 6t j |  d 6t j |  d 6} t t j |    n  d  } } } } d  S(   Nt   readonlydirt   diri   t   500i   Rq   R
   sR   assert not %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(exists=%(py4)s)
}R   t   readonly_dirR   R   R   (   R   Rs   Rt   t   intRu   R   R   R   R   R   R   R   R   R   (   R(   R   R{   R   R   R   R   Rv   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt    test_remove_removes_readonly_dirG   s    
	     u  c   	      C  s  | j  d  j d d  } | j  d  j   } | j d  | j   | j } d } | d |  } | } | sÿ d d i t j |  d	 6d
 t j   k s­ t j	 |  rŒ t j |  n d
 d 6t j |  d 6t j |  d 6} t
 t j |    n  d  } } } } d  S(   NRx   Ry   i   t   readonlyfilei    Rq   R
   sR   assert not %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(exists=%(py4)s)
}R   R{   R   R   R   (   R   Rs   Rt   Ru   R   R   R   R   R   R   R   R   R   (	   R(   R   R{   Rr   R   R   R   R   Rv   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt)   test_remove_removes_dir_and_readonly_fileM   s    
	     u  c   	        sz  g    | j  t j j d   f d    | j     d d } | } | s d i t j |  d 6} t t j |    n  d  } } xê t
 t f D]Ü } g    (| j d |    d d } | | k } | sht j d | f d | | f  i d
 t j   k st j |  r$t j |  n d
 d 6t j |  d 6} d i | d 6} t t j |    n  d  } } q Wd  S(   Nt   rmtreec            s     j  |  S(   N(   t   append(   t   argst   kwargs(   t   l(    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   <lambda>W   s    i    t   ignore_errorsR
   s   assert not %(py1)st   py1s   ==s   %(py1)s == %(py3)st   valt   py3s   assert %(py5)sRE   s   assert not %(py1)s(   s   ==(   s   %(py1)s == %(py3)ss   assert %(py5)s(   t   setattrRF   t   stdt   shutilRu   R   R   R   R   R   RD   t   FalseR3   R   R   R   (	   R(   R   t   monkeypatcht   @py_assert0t   @py_assert2R6   R   t   @py_format4t   @py_format6(    (   R   s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt    test_remove_routes_ignore_errorsT   s(    
     
   l   c   
      C  sË  t    } t |  } t j } | j } | j } |   } | | k } | r©t j d f | f d f | | f  i	 t j |  d 6t j |  d 6t j |  d 6t j |  d 6d t	 j
   k pÑ t j t   rã t j t   n d d 6d	 t	 j
   k pt j t  rt j t  n d	 d
 6d t	 j
   k p?t j t  rQt j t  n d d 6t j |  d 6t j |  d 6} d d i | d 6}	 t t j |	    n  t } } } } } } } d  S(   Ns   ==s±   %(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s()
})
} == %(py15)s
{%(py15)s = %(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py9)s
{%(py9)s = %(py7)s.std
}.os
}.getcwd
}()
}R@   RA   RB   R   R   R   t   strR   RF   RC   RE   RG   R
   s   assert %(py17)sR?   (   R   R   RF   R   t   ost   getcwdR   R3   R   R   R   R   R   R   R   (
   R(   R   t   @py_assert4RS   RO   RP   RQ   RN   Rn   RT   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_initialize_curdir_   s    	  	 	 	 	   ÿ 1   c         C  sÒ  | j  d d d } | j   | j   t j t j j t j j	  | j } |   } | t
 k } | rPt j d f | f d f | t
 f  i t j |  d 6d t j   k p¿ t j |  rÑ t j |  n d d 6d	 t j   k pö t j t
  rt j t
  n d	 d
 6t j |  d 6} d d i | d 6} t t j |    n  t
 } } } t j } |   } t |  } | | k } | rŒt j d f | f d f | | f  i t j |  d 6d t j   k pät j t  röt j t  n d d 6d t j   k pt j |  r-t j |  n d d 6d t j   k pRt j t  rdt j t  n d d
 6t j |  d 6t j |  d 6}	 d d i |	 d 6}
 t t j |
    n  t
 } } } } d  S(   Nt   dir_to_be_removedRy   i   t   issD   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.chdir
}()
} is %(py6)sR   R   R   R   R   R   R
   s   assert %(py8)sR   s   ==sc   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.getcwd
}()
} == %(py9)s
{%(py9)s = %(py6)s(%(py7)s)
}R   RC   R   RG   s   assert %(py11)sRB   (   Rs   t   chdirRu   t   pytestRk   RF   t   errort   ENOENTR)   R   R   R   R3   R   R   R   R   R   R   R   R   R   (   R(   R   R2   R   R   R   t   @py_format7R5   RS   t   @py_format10t   @py_format12(    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_chdir_goneb   s,    

	 	   ¹   	 	    ÿ    c      
   C  sÂ  | j  d d d } t j j   } | j   } | | k } | rt j d f | f d f | | f  i d t j   k p t j	 |  r t j
 |  n d d 6d t j   k pÂ t j	 |  rÔ t j
 |  n d d	 6} d
 d i | d 6} t t j |    n  t } t j } | j } |   }	 |	 | k }
 |
 r6t j d f |
 f d f |	 | f  i t j
 |  d 6d t j   k pt j	 t  r§t j
 t  n d d	 6d t j   k pÌt j	 |  rÞt j
 |  n d d 6t j
 |	  d 6t j
 |  d 6} d
 d i | d 6} t t j |    n  t } } }	 }
 Wd  QXt j } |   } t |  } | | k }	 |	 r¬t j d f |	 f d f | | f  i t j
 |  d 6d t j   k pÔt j	 t  ræt j
 t  n d d	 6d t j   k pt j	 |  rt j
 |  n d d 6d t j   k pBt j	 t  rTt j
 t  n d d 6t j
 |  d 6t j
 |  d 6} d
 d i | d 6} t t j |    n  t } } }	 } d  S(   Nt   subdirRy   i   s   ==s   %(py0)s == %(py2)st   oldR   t   xR   R
   s   assert %(py4)sR   s^   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.path
}.local
}()
} == %(py8)sRF   R   R   s   assert %(py10)sR   sc   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.getcwd
}()
} == %(py9)s
{%(py9)s = %(py6)s(%(py7)s)
}R   RC   R   RG   s   assert %(py11)sRB   (   Rs   RF   R)   R   t   as_cwdR   R3   R   R   R   R   R   R   R   R   R   R   (   R(   R   Ry   R€   R¥   R   R6   R7   R   R   R   R5   R    RS   R    R¡   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_as_cwdk   s8         	 	 	   É   	 	    ÿ    c   
   	   C  s  t  j j   } | j d d d } t j t  ! | j    t    Wd  QXWd  QXt  j } | j } |   } | | k } | sot j	 d | f d | | f  i d t
 j   k sÅ t j t   rÔ t j t   n d d 6d t
 j   k sü t j |  rt j |  n d d	 6t j |  d
 6t j |  d 6t j |  d 6} d i | d 6}	 t t j |	    n  d  } } } } d  S(   NR£   Ry   i   s   ==s^   %(py0)s == %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s.path
}.local
}()
}RF   R   R€   R   R   R   R   R
   s   assert %(py10)sR   (   s   ==(   s^   %(py0)s == %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s.path
}.local
}()
}s   assert %(py10)s(   RF   R)   R   Rs   R   Rk   Rl   RŠ   R   R3   R   R   R   R   R   R   R   (
   R(   R   R€   Ry   R   R   R   R   R5   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_as_cwd_exceptions   s    	 	 	   Ã   c         C  sÂ   | j    ° t d  } | j } |   } | s® d d i t j |  d 6d t j   k sl t j |  r{ t j |  n d d 6t j |  d 6} t t j	 |    n  d  } } Wd  QXd  S(   NR	   R
   s@   assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}R   R2   R   R   (   RŠ   R   R   R   R   R   R   R   R   R   R   (   R(   R   R2   R   R   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_initialize_reldir{   s    	 	  e  s4   sys.version_info < (2,6) and sys.platform == 'win32'c         C  sz  | j  d t |   t j j d d t } t j } | j } d } | |  } | | k } | s`t j	 d | f d | | f  i t j
 |  d 6d t j   k s¶ t j t  rÅ t j
 t  n d d 6d	 t j   k sí t j |  rü t j
 |  n d	 d
 6t j
 |  d 6t j
 |  d 6t j
 |  d 6}	 d i |	 d 6}
 t t j |
    n  d  } } } } } d  S(   Nt   HOMEt   ~t
   expandusers   ==sl   %(py0)s == %(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s.path
}.expanduser
}(%(py8)s)
}R   R   R   R2   R   R   R   R   R
   s   assert %(py12)sR<   (   s   ==(   sl   %(py0)s == %(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s.path
}.expanduser
}(%(py8)s)
}s   assert %(py12)s(   t   setenvR   RF   R)   R   RD   R   R¬   R   R3   R   R   R   R   R   R   R   (   R(   R   R   R2   R   R   R   R   R   R    t   @py_format13(    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_tilde_expansion   s    	 	     Ó   c         C  s~  | j  d  } t |  } | | k } | sé t j d | f d | | f  i d t j   k so t j |  r~ t j |  n d d 6d t j   k sŠ t j |  rµ t j |  n d d 6} d i | d
 6} t t j	 |    n  d  } | | k } | sœt j d | f d | | f  i d t j   k sCt j |  rRt j |  n d d 6d t j   k szt j |  rt j |  n d d 6} d i | d
 6} t t j	 |    n  d  } | j  d  } | | k } | s t j d | f d | | f  i d t j   k s&t j |  r5t j |  n d d 6d t j   k s]t j |  rlt j |  n d d 6} d i | d
 6} t t j	 |    n  d  } | | k } | stt j d | f d | | f  i d t j   k sút j |  r	t j |  n d d 6d t j   k s1t j |  r@t j |  n d d 6} d i | d
 6} t t j	 |    n  d  } d  S(   Nt	   sampledirs   ==s   %(py0)s == %(py2)st   path2R   R   R   R
   s   assert %(py4)sR   R	   s   !=s   %(py0)s != %(py2)st   path3(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   s   !=(   s   %(py0)s != %(py2)ss   assert %(py4)s(   s   !=(   s   %(py0)s != %(py2)ss   assert %(py4)s(   R   R   R   R3   R   R   R   R   R   R   R   (   R(   R   R±   R   R6   R7   R²   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_eq_with_strings   s6                        c         C  sØ   | d  k } | sÎ t j d
 | f d | d  f  i d t j   k sT t j d   rc t j d   n d d 6d t j   k s t j |  r t j |  n d d 6} d i | d	 6} t t j |    n  d  } d  S(   Ns   !=s   %(py0)s != %(py2)sR   R   R   R   R
   s   assert %(py4)sR   (   s   !=(   s   %(py0)s != %(py2)ss   assert %(py4)s(	   R   R   R3   R   R   R   R   R   R   (   R(   R   R   R6   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_eq_with_none   s         c         C  ss  | j  d  } t | j  d   } | | k } | sò t j d | f d | | f  i d t j   k sx t j |  r t j |  n d d 6d t j   k s¯ t j |  rŸ t j |  n d d 6} d i | d 6} t t j	 |    n  d  } | | k  } | sÆt j d | f d  | | f  i d t j   k sLt j |  r[t j |  n d d 6d t j   k st j |  rt j |  n d d 6} d! i | d 6} t t j	 |    n  d  } d } | | k  } | syt j d" | f d# | | f  i t j |  d 6d t j   k s6t j |  rEt j |  n d d 6} d$ i | d 6}	 t t j	 |	    n  d  } } d }
 |
 | k } | s0t j d% | f d& |
 | f  i d t j   k sÝt j |  rìt j |  n d d 6t j |
  d 6} d' i | d 6}	 t t j	 |	    n  d  }
 } | j  d  } | | | g } t |  } | | | g } | | k } | sat j d( | f d) | | f  i t j |  d 6d t j   k s×t j |  ræt j |  n d d 6d t j   k st j t  rt j t  n d d 6t j |  d 6} d* i | d 6} t t j	 |    n  d  } } } d  S(+   NR°   t   tttt   >s   %(py0)s > %(py2)sR±   R   R²   R   R
   s   assert %(py4)sR   t   <s   %(py0)s < %(py2)ss   %(py0)s < %(py3)sR   s   assert %(py5)sRE   s   %(py1)s > %(py3)sR   t   aaas   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sR   t   sortedR   s   assert %(py8)sR   (   R¶   (   s   %(py0)s > %(py2)ss   assert %(py4)s(   R·   (   s   %(py0)s < %(py2)ss   assert %(py4)s(   R·   (   s   %(py0)s < %(py3)ss   assert %(py5)s(   R¶   (   s   %(py1)s > %(py3)ss   assert %(py5)s(   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   R   R   R   R3   R   R   R   R   R   R   R   R¹   (   R(   R   R±   R²   R   R6   R7   R   R   R   R   t   path4R   R   R   R   R5   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_gt_with_strings   sL                 l   
   l   
    ³   c   
      C  s5  | j  d d d  } | j d d d  } | j d  Wd  QX| j } |   } d } | | k } | st j d | f d | | f  i t j |  d
 6d t j   k sŒ t j	 |  rË t j |  n d d 6t j |  d 6t j |  d 6} d i | d 6}	 t
 t j |	    n  d  } } } } d  S(   Nt   sub1t   sub2t   filet   wRs   i   R\   s   ==sC   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py7)sR   R2   R   RC   R   R
   s   assert %(py9)sRG   (   s   ==(   sC   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py7)ss   assert %(py9)s(   R   t   openRg   t   readR   R3   R   R   R   R   R   R   R   (
   R(   R   R2   t   fR   R   RN   R   Rv   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_open_and_ensure   s    	 	       c   	      C  s  | j  d d d  } | j d d d | j } |   } d } | | k } | st j d | f d | | f  i t j |  d	 6d
 t j   k s€ t j |  r³ t j |  n d
 d 6t j |  d 6t j |  d 6} d i | d 6} t	 t j
 |    n  d  } } } } d  S(   NRŒ   Rœ   RŸ   R\   Rs   i   s   ==sC   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py7)sR   R2   R   RC   R   R
   s   assert %(py9)sRG   (   s   ==(   sC   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py7)ss   assert %(py9)s(   R   Rg   RÁ   R   R3   R   R   R   R   R   R   R   (	   R(   R   R2   R   R   RN   R   Rv   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_write_and_ensure£   s    	 	       t   binc   
      C  sG  | j  d t |   } zi d d 6} | j | d | | j d  } t j j j |  } | | k } | s.t j	 d | f d | | f  i d t
 j   k sŽ t j |  rÃ t j |  n d d	 6d
 t
 j   k së t j |  rú t j |  n d
 d 6} d i | d 6}	 t t j |	    n  d  } Wd  | j   Xd  S(   Ns
   dumpfile%si*   t   answerRÅ   s   rb+s   ==s   %(py0)s == %(py2)st   dnewR   t   dR   R
   s   assert %(py4)sR   (   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   R   R|   t   dumpRÀ   RF   R   t   picklet   loadR   R3   R   R   R   R   R   R   R   t   close(
   R(   R   RÅ   R)   RÈ   RÂ   RÇ   R   R6   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt	   test_dumpš   s         
c         C  sö  d d  l  } d d  l } y) | j   \ } } t j j j |  Wn0 t k
 rs | j   } t	 | d  j   n Xzgt
 | j    d } t |  } | j } |   } | | k }	 |	 st j d |	 f d | | f  i t j |  d 6d t j   k st j |  rt j |  n d d 6d	 t j   k sFt j |  rUt j |  n d	 d
 6t j |  d 6}
 d i |
 d 6} t t j |    n  d  } } }	 | j |  | j } |   } | | k }	 |	 sŽt j d |	 f d | | f  i t j |  d 6d t j   k s*t j |  r9t j |  n d d 6d	 t j   k sat j |  rpt j |  n d	 d
 6t j |  d 6}
 d i |
 d 6} t t j |    n  d  } } }	 | j   | j } |   } | | k }	 |	 sÌt j d |	 f d | | f  i t j |  d 6d t j   k sBt j |  rQt j |  n d d 6d	 t j   k syt j |  rt j |  n d	 d
 6t j |  d 6}
 d i |
 d 6} t t j |    n  d  } } }	 Wd  t j j j |  Xd  S(   NiÿÿÿÿR¿   id   s   !=sD   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.mtime
}()
} != %(py6)sR   R)   R   t   mtimeR   R   R
   s   assert %(py8)sR   s   ==sD   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.mtime
}()
} == %(py6)s(   s   !=(   sD   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.mtime
}()
} != %(py6)ss   assert %(py8)s(   s   ==(   sD   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.mtime
}()
} == %(py6)ss   assert %(py8)s(   s   !=(   sD   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.mtime
}()
} != %(py6)ss   assert %(py8)s(   t   tempfilet   timet   mkstempRF   R   R   RÌ   t   AttributeErrort   mktempRÀ   R|   R   RÎ   R   R3   R   R   R   R   R   R   R   t   setmtimeRu   (   R(   RÏ   RÐ   t   fdt   nameRÎ   R)   R   R   R   R   R5   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_setmtimeŽ   sL    	 	   ³   	 	   ³   
	 	   ³   c   	      C  s¯  | j  d  } | j  d  } t |  } t |  } | | k } | rt j d f | f d f | | f  i t j |  d 6d t j   k p t j |  r° t j |  n d d 6d t j   k pÕ t j t  rç t j t  n d d	 6d
 t j   k pt j |  rt j |  n d
 d 6d t j   k pCt j t  rUt j t  n d d 6t j |  d 6} d d i | d 6} t t j	 |    n  t
 } } } d  S(   Ns	   /otherdirt   otherdirs   ==sN   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py8)s
{%(py8)s = %(py5)s(%(py6)s)
}R   t   new1R   R   R   t   new2R   RE   R   R
   s   assert %(py10)sR   (   R   R   R   R3   R   R   R   R   R   R   R   (	   R(   R   RÙ   RÚ   R   R   R   R5   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_normpathÉ   s        ÿ (   c         C  sç   t  j   } zÃ | j } d } | d |  } | sÀ d d i t j |  d 6d t j   k sn t j |  r} t j |  n d d 6t j |  d 6t j |  d	 6} t t j	 |    n  d  } } } Wd  | j d
 d  Xd  S(   Ni   Ry   R
   sK   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(dir=%(py4)s)
}R   RÈ   R   R   R   t   rec(   R   t   mkdtempR   R   R   R   R   R   R   R   R   Ru   (   R(   RÈ   R   R   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_mkdtemp_creationÎ   s    	    u  c         C  s  t  j   } t  j   } zÑ| j } d } | d |  } | sÌ d d i t j |  d 6d t j   k sz t j |  r t j |  n d d 6t j |  d 6t j |  d	 6} t	 t j
 |    n  d  } } } | j } |   } | | k } | sÚt j d | f d | | f  i t j |  d 6d t j   k sPt j |  r_t j |  n d d 6d t j   k st j |  rt j |  n d d 6t j |  d	 6} d i | d 6} t	 t j
 |    n  d  } } } Wd  | j d d  Xd  S(   Ni   Ry   R
   sK   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(dir=%(py4)s)
}R   RÈ   R   R   R   s   ==sF   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.dirpath
}()
} == %(py6)st   tmproots   assert %(py8)sR   RÜ   (   s   ==(   sF   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.dirpath
}()
} == %(py6)ss   assert %(py8)s(   R   RÝ   t   get_temprootR   R   R   R   R   R   R   R   R   RI   R3   Ru   (   R(   RÈ   Rß   R   R   R   R   R5   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_tmprootÕ   s&    	    u  	 	   ³   c         C  sb  t    } zG| j   } t |  } t |  } | | k } | rt j d f | f d f | | f  i t j |  d 6d t j   k p t j |  rª t j |  n d d 6d t j   k pÏ t j t  rá t j t  n d d 6d t j   k pt j |  rt j |  n d d	 6d t j   k p=t j t  rOt j t  n d d
 6t j |  d 6} d d i | d 6} t	 t j
 |    n  t } } } t j }	 |	 j }
 |
 j } |   } t |  } | | k } | r5t j d f | f d f | | f  i t j |  d 6d t j   k p=t j |  rOt j |  n d d 6d t j   k ptt j t  rt j t  n d d 6t j |	  d 6d t j   k p»t j t  rÍt j t  n d d 6t j |  d	 6t j |
  d 6t j |  d 6} d d i | d 6} t	 t j
 |    n  t }	 }
 } } } } Wd  | j   Xd  S(   Ns   ==sN   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py8)s
{%(py8)s = %(py5)s(%(py6)s)
}R   t   resR   R   R   R€   R   RE   R   R
   s   assert %(py10)sR   s   %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.std
}.os
}.getcwd
}()
} == %(py13)s
{%(py13)s = %(py10)s(%(py11)s)
}RA   R   RB   R   RF   R   s   assert %(py15)sR@   (   R   R   R   R   R3   R   R   R   R   R   R   R   RF   R   R   R   (   R(   R   R€   Râ   R   R   R   R5   R    R   R   R   RP   R   t   @py_format14Rn   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt
   test_chdirÞ   s2    	    ÿ (   	 	 	 	    ÿ !   c         C  s¹  | j  d d  } | j   | j } d } | d |  } | sÍ d d i t j |  d 6d t j   k s{ t j |  r t j |  n d d	 6t j |  d
 6t j |  d 6} t t j	 |    n  d  } } } | j d  | j   | j   } d } | | k } | s«t j d | f d | | f  i t j |  d 6d t j   k sht j |  rwt j |  n d d	 6}	 d i |	 d 6}
 t t j	 |
    n  d  } } d  S(   Nt   test1Rj   i   RŸ   R
   sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(file=%(py4)s)
}R   t   newfileR   R   R   t   42s   ==s   %(py0)s == %(py3)sR   t   ss   assert %(py5)sRE   (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   R   Rs   R   R   R   R   R   R   R   R   R   Rg   RÁ   R3   (   R(   R   Ræ   R   R   R   R   Rè   R   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_ensure_filepath_withdirç   s&    
	    u  
   l   c   
      C  s²  | j  d  } | j   } | | k } | sé t j d | f d | | f  i d t j   k so t j |  r~ t j |  n d d 6d t j   k sŠ t j |  rµ t j |  n d d 6} d i | d
 6} t t j	 |    n  d  } | j } d } | d |  } | s d d i t j |  d 6d t j   k sNt j |  r]t j |  n d d 6t j |  d 6t j |  d
 6}	 t t j	 |	    n  d  } } } d  S(   Nt	   test1files   ==s   %(py0)s == %(py2)sRæ   R   t   tR   R
   s   assert %(py4)sR   i   RŸ   sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(file=%(py4)s)
}R   (   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   R   Rs   R   R3   R   R   R   R   R   R   R   R   (
   R(   R   Ræ   Rë   R   R6   R7   R   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_ensure_filepath_withoutdirð   s         	    u  c   
      C  s»  | j  d d  } | j d d  } | | k } | sò t j d | f d | | f  i d t j   k sx t j |  r t j |  n d d 6d	 t j   k s¯ t j |  rŸ t j |  n d	 d
 6} d i | d 6} t t j	 |    n  d  } | j } d } | d |  } | s©d d i t j |  d 6d t j   k sWt j |  rft j |  n d d
 6t j |  d 6t j |  d 6}	 t t j	 |	    n  d  } } } d  S(   NRå   t   testfileRy   i   s   ==s   %(py0)s == %(py2)sRæ   R   Rë   R   R
   s   assert %(py4)sR   sK   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(dir=%(py4)s)
}R   (   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   R   Rs   R   R3   R   R   R   R   R   R   R   R   (
   R(   R   Ræ   Rë   R   R6   R7   R   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_ensure_dirpathö   s         	    u  c         C  sÑ  t    } t  |  } | | k } | sã t j d | f d | | f  i d t j   k si t j |  rx t j |  n d d 6d t j   k s  t j |  r¯ t j |  n d d 6} d i | d	 6} t t j |    n  d  } t
 j j d
  } t  |  } | | k	 } | sÕt j d | f d | | f  i d t j   k s[t j |  rjt j |  n d d 6d t j   k st j |  r¡t j |  n d d 6} d i | d	 6} t t j |    n  d  } | j } | j }	 | |	 k }
 |
 sÛt j d |
 f d  | |	 f  i t j |  d 6d t j   k sQt j |  r`t j |  n d d 6t j |	  d 6d t j   k st j |  r§t j |  n d d	 6} d! i | d 6} t t j |    n  d  } }
 }	 d } t | |  } | } | s¿d d i t j |  d 6d t j   k sFt j |  rUt j |  n d d 6d t j   k s}t j t  rt j t  n d d 6t j |  d 6} t t j |    n  d  } } } d  S("   Ns   ==s   %(py0)s == %(py2)sR   R   t   l2R   R
   s   assert %(py4)sR   R1   s   is nots   %(py0)s is not %(py2)st   wct   l3sL   %(py2)s
{%(py2)s = %(py0)s.strpath
} == %(py6)s
{%(py6)s = %(py4)s.strpath
}R   s   assert %(py8)sR   t   commits9   assert not %(py5)s
{%(py5)s = %(py0)s(%(py1)s, %(py3)s)
}R   R   t   hasattrRE   (   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   s   is not(   s   %(py0)s is not %(py2)ss   assert %(py4)s(   s   ==(   sL   %(py2)s
{%(py2)s = %(py0)s.strpath
} == %(py6)s
{%(py6)s = %(py4)s.strpath
}s   assert %(py8)s(   R   R   R3   R   R   R   R   R   R   R   RF   R)   t   svnwct   strpathRó   (   R(   R   R   Rï   R   R6   R7   Rð   Rñ   R   R   R   R5   R   R   RN   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_init_from_pathü   s>    	          	 	   ³         t   runt   reasons!   unreliable est for long filenamesc         C  s\  t  j d k r" t j j d  n  d d } | j |  } | j d t  | j d  | j |  } | j	 } |   } d } | | k } | sFt
 j d | f d | | f  i t
 j |  d	 6d
 t j   k sã t
 j |  rò t
 j |  n d
 d 6t
 j |  d 6t
 j |  d 6}	 d i |	 d 6}
 t t
 j |
    n  d  } } } } d  S(   Nt   win32s/   win32: work around needed for path length limits   /testi<   RŸ   R9   s   ==sC   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py7)sR   Rï   R   RC   R   R
   s   assert %(py9)sRG   (   s   ==(   sC   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py7)ss   assert %(py9)s(   t   syst   platformRF   Rj   t   skipR   Rs   RD   Rg   RÁ   R   R3   R   R   R   R   R   R   R   (   R(   R   t   newfilenameR   Rï   R   R   RN   R   Rv   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_long_filenames  s     
	 	       c         C  s  | j  d d  } | j  d d  } | j  d  } t | j d     } t |  } d } | | k } | sKt j d | f d | | f  i t j |  d
 6d t j   k sÁ t j	 |  rÐ t j |  n d d 6d t j   k sø t j	 t  rt j t  n d d 6t j |  d 6}	 d i |	 d 6}
 t
 t j |
    n  d  } } } | d } | | k } | s
t j d | f d | | f  i d t j   k s·t j	 |  rÆt j |  n d d
 6t j |  d 6} d i | d 6} t
 t j |    n  d  } } d  S(   Nt   at   1t   bt   2t   breadthc         S  s   |  j  d d  S(   NRŸ   i   (   R   (   R¥   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR     s    i   s   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sR   R   R   t   lenR   R   R
   s   assert %(py8)sR   i   s   %(py1)s == %(py3)st   p3s   assert %(py5)sRE   (   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   s   ==(   s   %(py1)s == %(py3)ss   assert %(py5)s(   Rs   t   listt   visitR  R   R3   R   R   R   R   R   R   R   (   R(   R   t   p1t   p2R  R   R   R   R   R   R5   R   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_visit_depth_first  s&        ³   
   l   c         C  s  | j  d d  } | j  d d  } t | j d d d  } t |  } d } | | k } | s?t j d | f d | | f  i t j |  d 6d t j   k sµ t j	 |  rÄ t j |  n d d 6d t j   k sì t j	 t  rû t j t  n d d 6t j |  d 6} d i | d 6}	 t
 t j |	    n  d  } } } | d }
 |
 | k } | sþt j d | f d |
 | f  i d t j   k s«t j	 |  rºt j |  n d d 6t j |
  d 6} d i | d 6} t
 t j |    n  d  }
 } d  S(   NRÿ   t   123s   .bt   345s   ???RÜ   s   [!.]*i   s   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sR   R   R   R  R   R   R
   s   assert %(py8)sR   i    s   %(py1)s == %(py3)sR  s   assert %(py5)sRE   (   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   s   ==(   s   %(py1)s == %(py3)ss   assert %(py5)s(   Rs   R  R  R  R   R3   R   R   R   R   R   R   R   (   R(   R   R  R	  R   R   R   R   R   R5   R   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_visit_rec_fnmatch!  s$        ³   
   l   c         C  s]  | j  d d  } | j } t j } | j  } d } | |  } | |  } | sEd d i t j |  d 6t j |  d 6d t j   k s t j t  r« t j t  n d d	 6t j |  d
 6d t j   k sã t j |  rò t j |  n d d 6t j |  d 6t j |  d 6t j |  d 6}	 t	 t j
 |	    n  d  } } } } } } t j j  t |  d d g  }
 | j } | |
  } | sOd d i d t j   k sÆt j |
  rÕt j |
  n d d	 6t j |  d
 6d t j   k st j |  rt j |  n d d 6t j |  d 6} t	 t j
 |    n  d  } } d  S(   NRÿ   R  t   abR
   s   assert %(py13)s
{%(py13)s = %(py2)s
{%(py2)s = %(py0)s.fnmatch
}(%(py11)s
{%(py11)s = %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.sep
}.join
}(%(py9)s)
})
}RA   RB   R   R   R   R   RC   RE   RG   t   *sI   assert %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.fnmatch
}(%(py3)s)
}t   pattern(   R   t   fnmatchR   t   sepR   R   R   R   R   R   R   R   R   (   R(   R   R  R   R   RN   RS   RO   RP   Rã   R  R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_fnmatch_file_abspath)  s$    	 	 	     Ü  !	     c         C  s  t  j d k o d p d } t j j j |  } | j } d } | d |  } | râ d d i t j |  d 6d	 t	 j
   k p t j |  r t j |  n d	 d
 6t j |  d 6t j |  d 6} t t j |    n  t } } } t j } | j } | j } d } | |  } | t k }	 |	 rFt j d f |	 f d f | t f  i d t	 j
   k put j t  rt j t  n d d 6t j |  d 6t j |  d 6d t	 j
   k pÌt j t  rÞt j t  n d d
 6t j |  d 6t j |  d 6t j |  d 6}
 d d i |
 d 6} t t j |    n  t } } } } } }	 t j } | j } | j } g  } | | d | } | t k } | rót j d f | f d f | t f  i d t	 j
   k pët j t  rýt j t  n d d 6t j |  d 6t j |  d 6d t	 j
   k pBt j t  rTt j t  n d d
 6d t	 j
   k pyt j |  rt j |  n d d 6t j |  d 6t j |  d 6t j |  d 6} d d i | d 6} t t j |    n  t } } } } } } t j j j | d | j   g } | | k } | r
t j d  f | f d! f | | f  i d	 t	 j
   k pt j |  rt j |  n d	 d 6d" t	 j
   k pÀt j |  rÒt j |  n d" d
 6} d d# i | d 6} t t j |    n  t } d  S($   NRù   t   cmdRj   i   RŸ   R
   sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(file=%(py4)s)
}R   R¥   R   R   R   t   jaksdkasldqweR   s   %(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.path
}.local
}.sysfind
}(%(py8)s)
} is %(py12)sR   R<   R   RF   R   s   assert %(py14)sR;   t   pathss   %(py11)s
{%(py11)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.path
}.local
}.sysfind
}(%(py7)s, paths=%(py9)s)
} is %(py13)sRA   RB   RÖ   RC   RG   s   assert %(py15)sR@   s   ==s   %(py0)s == %(py2)st   x2s   assert %(py4)s(   Rú   Rû   RF   R)   R   t   sysfindR   R   R   R   R   R   R   R   R   R3   RI   (   R(   RÖ   R¥   R   R   R   R   R   R   RJ   R®   RL   RS   RO   RP   Rã   Rn   R  R6   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_sysfind/  sN    	    u  	 	 	     é   	 	 	     ÿ !   $     c         C  sW  t  j j |  } | j   } | j } | d |  } | rñ d d i d t j   k pe t j |  rw t j	 |  n d d 6t j	 |  d 6d t j   k p¬ t j |  rŸ t j	 |  n d d 6t j	 |  d	 6} t
 t j |    n  t } } | j } | |  } | j } t j } | j }	 | j }
 |	 |
 |  } | | k } | r1t j d
 f | f d f | | f  i t j	 |  d 6d t j   k p«t j |  rœt j	 |  n d d 6t j	 |
  d 6d t j   k pòt j |  rt j	 |  n d d 6t j	 |	  d 6t j	 |  d 6d t j   k pIt j |  r[t j	 |  n d d 6t j	 |  d 6d t j   k pt j |  r¢t j	 |  n d d 6t j	 |  d 6t j	 |  d	 6d t j   k pçt j t  rùt j	 t  n d d 6} d d i | d 6} t
 t j |    n  t } } } } } }	 }
 } d  S(   Nt   endswithR
   sP   assert %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.check
}(endswith=%(py3)s)
}t   str_pathR   R   t   py_pathR   RE   s   ==sé   %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py3)s)
}.strpath
} == %(py19)s
{%(py19)s = %(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py9)s.path
}.join
}(%(py16)s
{%(py16)s = %(py14)s.strpath
}, %(py17)s)
}RH   R?   R=   R;   RA   RB   t   fake_fspath_objRC   R   RG   s   assert %(py21)st   py21(   RF   R)   R   R+   R   R   R   R   R   R   R   R   R   R   Rõ   R   R3   (   R(   R  R  R  R   R   R   RN   RO   RP   t   @py_assert15t   @py_assert18RS   RU   t   @py_format22(    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt    test_fspath_protocol_other_class8  s,    	     
	  	 	 	 	    ÿ ¯   (.   R,   R-   R8   t   skiponwin32RV   Ro   Rw   R}   R   R   R   R¢   R§   Rš   R©   R   t   markt   xfailR¯   R³   RŽ   R»   RÃ   RÄ   RF   Rj   t   multiR   RD   RÍ   t   failsonjywin32R×   RÛ   RÞ   Rá   Rä   Ré   Rì   Rî   Rö   Rþ   R
  R  R  R  R"  (    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR0   (   sD   																	'											'						t   TestExecutionOnWindowsc           B  s   e  Z e Z d    Z RS(   c         C  s(  | j  d t |  d t j | j d  | j d  } t j j j d  } | | k } | st	 j
 d | f d | | f  i d t j   k s€ t	 j |  r³ t	 j |  n d d 6d	 t j   k sÛ t	 j |  rê t	 j |  n d	 d
 6} d i | d 6} t t	 j |    n  d  } d  S(   Nt   PATHt   prependR\   s	   hello.bats   ==s   %(py0)s == %(py2)st   hR   R¥   R   R
   s   assert %(py4)sR   (   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   R­   R   R   t   pathsepRs   RF   R)   R   R  R   R3   R   R   R   R   R   R   R   (   R(   R   R   R+  R¥   R   R6   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_sysfind_bat_exe_beforeD  s         (   R,   R-   t	   win32onlyt
   pytestmarkR-  (    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR(  A  s   t   TestExecutionc           B  s_   e  Z e Z d    Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z RS(	   c         C  s¡  | j  d d t } | j d | d d | j d  t j } | j } | j } d } | |  } | d  k }	 |	 st	 j
 d |	 f d | d  f  i d
 t j   k s¹ t	 j d   rÈ t	 j d   n d
 d 6t	 j |  d 6t	 j |  d 6d t j   k st	 j t  rt	 j t  n d d 6t	 j |  d 6t	 j |  d 6t	 j |  d 6}
 d i |
 d 6} t t	 j |    n  d  } } } } } }	 d  S(   Nt   nopermRy   R)  R*  t   :i    R  R   s   %(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.path
}.local
}.sysfind
}(%(py8)s)
} is %(py12)sR   R<   R   R   RF   R   R   R   R   R
   s   assert %(py14)sR;   (   R   (   s   %(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.path
}.local
}.sysfind
}(%(py8)s)
} is %(py12)ss   assert %(py14)s(   Rs   RD   R­   Rt   RF   R)   R   R  R   R   R3   R   R   R   R   R   R   (   R(   R   R   R1  R   R   R   R   R   RJ   R®   RL   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt!   test_sysfind_no_permisson_ignoredO  s    	 	 	     ã   c   	      C  s  t  j j j d  } | j } d } | d |  } | sÆ d d i t j |  d 6d t j   k st t j	 |  r t j |  n d d 6t j |  d	 6t j |  d
 6} t
 t j |    n  d  } } } t  j j j t |   } | j } d } | d |  } | s d d i t j |  d 6d t j   k sNt j	 |  r]t j |  n d d 6t j |  d	 6t j |  d
 6} t
 t j |    n  d  } } } | | k } | s|t j d | f d | | f  i d t j   k st j	 |  rt j |  n d d 6d t j   k s9t j	 |  rHt j |  n d d 6} d i | d
 6} t
 t j |    n  d  } d  S(   NRj   i   RŸ   R
   sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(file=%(py4)s)
}R   R¥   R   R   R   t   ys   ==s   %(py0)s == %(py2)ss   assert %(py4)s(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   RF   R)   R   R  R   R   R   R   R   R   R   R   R   R   R3   (	   R(   R¥   R   R   R   R   R4  R6   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_sysfind_absoluteU  s,    	    u  	    u       c         C  s  | j  d d | j d  | j d  f d d | j d d  d   } t j j j d d | } | j } d } | | k } | r7t j	 d	 f | f d
 f | | f  i t j
 |  d 6d t j   k pÝ t j |  rï t j
 |  n d d 6t j
 |  d 6} d d i | d 6}	 t t j |	    n  t } } } | j } |   } | j }
 d } |
 | k } | rHt j	 d	 f | f d f |
 | f  i t j
 |  d 6t j
 |  d 6d t j   k pÞt j |  rðt j
 |  n d d 6t j
 |
  d 6t j
 |  d 6} d d i | d 6} t t j |    n  t } } }
 } } d   } t j } | j } | j }
 d } |
 | d | } | t k } | rút j	 d f | f d f | t f  i d t j   k pòt j t  rt j
 t  n d d 6t j
 |  d 6t j
 |  d 6d t j   k pIt j t  r[t j
 t  n d d 6t j
 |
  d 6t j
 |  d 6d t j   k p t j |  r²t j
 |  n d d 6t j
 |  d 6} d d i | d  6} t t j |    n  t } } }
 } } } d  S(!   NR)  s   %s:%sRÿ   R  R*  R2  c         S  s   |  j    j d k S(   NR  (   RI   R4   (   R¥   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR   b  s    t   checkers   ==s0   %(py2)s
{%(py2)s = %(py0)s.basename
} == %(py5)sR   R¥   R   RE   R
   s   assert %(py7)sRC   sd   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.dirpath
}()
}.basename
} == %(py9)sRG   R   R   s   assert %(py11)sRB   c         S  s   d  S(   N(   R   (   R¥   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR   f  s    R   s   %(py11)s
{%(py11)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.path
}.local
}.sysfind
}(%(py8)s, checker=%(py9)s)
} is %(py13)sR   RA   RF   R   s   assert %(py15)sR@   (   R­   Rs   R   RF   R)   R   R  R4   R   R3   R   R   R   R   R   R   R   RI   (   R(   R   R   R6  R¥   R   R   R   R   Rv   R   RS   R   R    R¡   RO   RP   Rã   Rn   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_sysfind_multiple\  sL    			       	 	 	    ¢   		 	 	     ÿ !   c   
      C  s  t  j j j d  } | j d  } xet  j j   j   D]N} | j } | j } | |  } d } | | k } | srt j	 d | f d | | f  i t j
 |  d 6d t j   k sÈ t j |  r× t j
 |  n d d 6t j
 |  d	 6d
 t j   k st j |  rt j
 |  n d
 d 6t j
 |  d 6t j
 |  d 6} d i | d 6}	 t t j |	    n  d  } } } } } q: Wd  S(   Nt   lss   -aiÿÿÿÿs   !=si   %(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.find
}(%(py5)s
{%(py5)s = %(py3)s.basename
})
} != %(py10)sR   R¥   R   R   t   outR   RC   RE   R
   s   assert %(py12)sR<   (   s   !=(   si   %(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.find
}(%(py5)s
{%(py5)s = %(py3)s.basename
})
} != %(py10)ss   assert %(py12)s(   RF   R)   R   R  t   sysexect   listdirt   findR4   R   R3   R   R   R   R   R   R   R   (
   R(   R¥   R9  R   R   RN   R   RS   R    R®   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_sysexeci  s    	 	     Ó   c         C  s5   t  j j j d  } t  j j t  j j j d  d  S(   Nt   falses-   
            x.sysexec('aksjdkasjd')
        (	   RF   R)   R   R  Rj   Rk   t   processt   cmdexect   Error(   R(   R¥   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_sysexec_failingo  s    c      
   C  s  | j  d d d xöt d  D]è} t j d d d | d d	 d
 d  } | j } |   } | rà d d i t j |  d 6d t j   k p t j	 |  r­ t j |  n d d 6t j |  d 6} t
 t j |    n  t } } | j } d } | | } | | k } | rüt j d f | f d f | | f  i t j |  d 6d t j   k pkt j	 |  r}t j |  n d d 6d t j   k p¢t j	 |  rŽt j |  n d d 6t j |  d 6}	 d d i |	 d 6}
 t
 t j |
    n  t } } } } | d k r³| j } d } | | } t |  } | d |  } | j } |   } | rd d i	 t j |  d 6t j |  d 6t j |  d 6d t j   k p¿t j	 t  rÑt j t  n d d  6t j |  d 6d t j   k pt j	 |  rt j |  n d d 6t j |  d 6d t j   k pMt j	 |  r_t j |  n d d 6t j |  d 6} t
 t j |    n  t } } } } } } } n  | d	 k rX| j } d	 } | | } t |  } | d |  } | j } |   } | r7d d i	 t j |  d 6t j |  d 6t j |  d 6d t j   k pdt j	 t  rvt j t  n d d  6t j |  d 6d t j   k p«t j	 |  rœt j |  n d d 6t j |  d 6d t j   k pòt j	 |  rt j |  n d d 6t j |  d 6} t
 t j |    n  t } } } } } } } n  | d! k r| j } d! } | | } t |  } | d |  } | j } |   } | } | rãd d" i	 t j |  d 6t j |  d 6t j |  d 6d t j   k pt j	 t  r"t j t  n d d  6t j |  d 6d t j   k pWt j	 |  rit j |  n d d 6t j |  d 6d t j   k pt j	 |  r°t j |  n d d 6t j |  d 6} t
 t j |    n  t } } } } } } } } n  q  Wd  S(#   Ns   base.not_an_intRy   i   i
   t   prefixs   base.t   rootdirt   keepi   t   lock_timeouti    R
   s@   assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}R   t   numdirR   R   s   base.%ds   ==s=   %(py2)s
{%(py2)s = %(py0)s.basename
} == (%(py5)s %% %(py6)s)t   iR   RE   s   assert %(py9)sRG   t   exts«   assert %(py15)s
{%(py15)s = %(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py2)s
{%(py2)s = %(py0)s.new
}(ext=%(py9)s
{%(py9)s = %(py3)s((%(py4)s - %(py6)s))
})
}.check
}()
}R@   RA   RB   R   R   i   s¯   assert not %(py15)s
{%(py15)s = %(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py2)s
{%(py2)s = %(py0)s.new
}(ext=%(py9)s
{%(py9)s = %(py3)s((%(py4)s - %(py6)s))
})
}.check
}()
}(   Rs   t   rangeR   t   make_numbered_dirR   R   R   R   R   R   R   R   R   R4   R3   t   newR   (   R(   R   RH  RG  R   R   R7   R   R   Rv   R    R   RS   RO   RP   RQ   Rn   RR   RM   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_make_numbered_diru  sv    	 	  e  
	  
   ¹   	  
   	 	  ÿ   !	  
   	 	  ÿ   !	  
   	 	   ÿ   c   
      C  s¶  d   } | j  t j j d |  | j d | d d  } | j } | |  } | s	d d i d t j   k s t j	 |  r t j
 |  n d d	 6t j
 |  d
 6d t j   k sÇ t j	 |  rÖ t j
 |  n d d 6t j
 |  d 6} t t j |    n  d  } } | j } |   } | sšd d i t j
 |  d
 6d t j   k sft j	 |  rut j
 |  n d d 6t j
 |  d 6}	 t t j |	    n  d  } } d  S(   Nc         S  s   t  d   d  S(   Ni*   (   t   NotImplementedError(   R¥   R4  (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   notimpl  s    t   symlinkRD  RF  i    R
   sG   assert %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.relto
}(%(py3)s)
}R   R   R   R¥   R   RE   s@   assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}R   (   R   RF   R   R   RK  t   reltoR   R   R   R   R   R   R   R   R   (
   R(   R   R   RO  R¥   R   R   R   R   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt+   test_make_numbered_dir_NotImplemented_Error  s    		     
	 	  e  c         C  s  x{t  d  D]m} t j d d d | d d  } | j } |   } | rÇ d d i t j |  d	 6d
 t j   k p t j |  r t j |  n d
 d 6t j |  d 6} t	 t j
 |    n  t } } | j } d } | | } | | k } | rãt j d f | f d f | | f  i t j |  d	 6d
 t j   k pRt j |  rdt j |  n d
 d 6d t j   k pt j |  rt j |  n d d 6t j |  d 6}	 d d i |	 d 6}
 t	 t j
 |
    n  t } } } } xt  |  D]t} | j } t |  } | d |  } | j } |   } | r`d d i t j |  d 6t j |  d 6d t j   k pt j t  rt j t  n d d 6t j |  d	 6d
 t j   k pÔt j |  ræt j |  n d
 d 6t j |  d 6d t j   k pt j |  r-t j |  n d d 6t j |  d 6} t	 t j
 |    n  t } } } } } qWq Wd  S(   Ni
   RC  s   base2.RD  RE  i   R
   s@   assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}R   RG  R   R   s   base2.%ds   ==s=   %(py2)s
{%(py2)s = %(py0)s.basename
} == (%(py5)s %% %(py6)s)RH  R   RE   s   assert %(py9)sRG   RI  s   assert %(py12)s
{%(py12)s = %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.new
}(ext=%(py6)s
{%(py6)s = %(py3)s(%(py4)s)
})
}.check
}()
}R<   R   R   R   t   jR   (   RJ  R   RK  R   R   R   R   R   R   R   R   R   R4   R3   RL  R   (   R(   R   RH  RG  R   R   R7   R   R   Rv   R    RS  R   R   RJ   R®   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_locked_make_numbered_dir  s:    		 	  e  
	  
   ¹   	   	 	  ÿ   c         C  sB   t  j j t | j d  j  t  j j t | j d  j  d  S(   Nt   qwoeqiwe(   RF   Rj   Rk   t   EnvironmentErrorR   RÎ   RÁ   (   R(   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_error_preservation  s    (   R,   R-   R#  R/  R3  R5  R7  R=  RB  RM  RR  RT  RW  (    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR0  L  s   									t
   TestImportc           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 RS(   c         C  sÁ  | j  d  j   } | j } d } | | k } | sÛ t j d | f d | | f  i t j |  d 6d t j   k s t j |  r t j |  n d d 6t j |  d 6} d i | d 6} t	 t j
 |    n  d  } } } | j } d } | | k } | s¯t j d | f d | | f  i t j |  d 6d t j   k s\t j |  rkt j |  n d d 6t j |  d 6} d i | d 6} t	 t j
 |    n  d  } } } d  S(   Ns   execfile.pyi*   s   ==s)   %(py2)s
{%(py2)s = %(py0)s.x
} == %(py5)sR   t   objR   RE   R
   s   assert %(py7)sRC   t   execfiles0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)s(   s   ==(   s)   %(py2)s
{%(py2)s = %(py0)s.x
} == %(py5)ss   assert %(py7)s(   s   ==(   s0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)ss   assert %(py7)s(   R   t   pyimportR¥   R   R3   R   R   R   R   R   R   R   R,   (   R(   R   RY  R   R   R   R   Rv   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_pyimport  s"    	    |   	    |   c           s[     j  d d  } | j     j d  j   j d   t j   j   f d    d  S(   NRÿ   s   test_x123.pyR  c             s     j  d d  j   S(   NR  s   test_x123.py(   R   R[  (    (   R   (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR   š  s    (   Rs   R[  R   t   moveR   Rk   t   ImportMismatchError(   R(   R   R2   (    (   R   s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt*   test_pyimport_renamed_dir_creates_mismatch£  s
    
c         C  s   | j  d  } | j   } d  S(   Ns   foo__init__.py(   Rs   R[  (   R(   R   R)   RY  (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_pyimport_messy_nameª  s    c   
      C  sâ  | j  d  } | j d  } | j   } | j } d } | | k } | sð t j d | f d | | f  i t j |  d 6d t j   k s t j	 |  r¬ t j |  n d d 6t j |  d 6} d i | d 6}	 t
 t j |	    n  d  } } } | j   } | j } d } | | k } | sÐt j d | f d | | f  i t j |  d 6d t j   k s}t j	 |  rt j |  n d d 6t j |  d 6} d i | d 6}	 t
 t j |	    n  d  } } } d  S(   Nt	   hello_123s   __init__.pys   ==s0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)sR   t   mR   RE   R
   s   assert %(py7)sRC   (   s   ==(   s0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)ss   assert %(py7)s(   s   ==(   s0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)ss   assert %(py7)s(   R   Rs   R[  R,   R   R3   R   R   R   R   R   R   R   (
   R(   R   R2   t   p_initRb  R   R   R   R   Rv   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_pyimport_dir¯  s(    	    |   	    |   c         C  sÇ  | j  d  j d d  } | j } d } | | k } | sá t j d | f d | | f  i t j |  d 6d t j   k s t j |  r t j |  n d d	 6t j |  d
 6} d i | d 6} t	 t j
 |    n  d  } } } | j } d } | | k } | sµt j d | f d | | f  i t j |  d 6d t j   k sbt j |  rqt j |  n d d	 6t j |  d
 6} d i | d 6} t	 t j
 |    n  d  } } } d  S(   Ns   execfile.pyt   modnames   0x.y.zi*   s   ==s)   %(py2)s
{%(py2)s = %(py0)s.x
} == %(py5)sR   RY  R   RE   R
   s   assert %(py7)sRC   s0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)s(   s   ==(   s)   %(py2)s
{%(py2)s = %(py0)s.x
} == %(py5)ss   assert %(py7)s(   s   ==(   s0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)ss   assert %(py7)s(   R   R[  R¥   R   R3   R   R   R   R   R   R   R   R,   (   R(   R   RY  R   R   R   R   Rv   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt%   test_pyimport_execfile_different_name·  s"    	    |   	    |   c   	      C  sÐ  | j  d  } | j  d  j   } | j } d } | | k } | sê t j d | f d | | f  i t j |  d 6d t j   k s t j |  rŠ t j |  n d d 6t j |  d	 6} d i | d 6} t	 t j
 |    n  d  } } } | j } d } | | k } | sŸt j d | f d | | f  i t j |  d 6d t j   k skt j |  rzt j |  n d d 6t j |  d	 6} d i | d 6} t	 t j
 |    n  d  } } } d  S(   NRØ   s   a.pys   got its   ==s.   %(py2)s
{%(py2)s = %(py0)s.result
} == %(py5)sR   t   modR   RE   R
   s   assert %(py7)sRC   s
   otherdir.as0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)s(   s   ==(   s.   %(py2)s
{%(py2)s = %(py0)s.result
} == %(py5)ss   assert %(py7)s(   s   ==(   s0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)ss   assert %(py7)s(   R   R[  t   resultR   R3   R   R   R   R   R   R   R   R,   (	   R(   R   RØ   Rg  R   R   R   R   Rv   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_pyimport_aŒ  s$    	    |   	    |   c   	      C  sÐ  | j  d  } | j  d  j   } | j } d } | | k } | sê t j d | f d | | f  i t j |  d 6d t j   k s t j |  rŠ t j |  n d d 6t j |  d	 6} d i | d 6} t	 t j
 |    n  d  } } } | j } d } | | k } | sŸt j d | f d | | f  i t j |  d 6d t j   k skt j |  rzt j |  n d d 6t j |  d	 6} d i | d 6} t	 t j
 |    n  d  } } } d  S(   NRØ   s   b.pys   got its   ==s-   %(py2)s
{%(py2)s = %(py0)s.stuff
} == %(py5)sR   Rg  R   RE   R
   s   assert %(py7)sRC   s
   otherdir.bs0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)s(   s   ==(   s-   %(py2)s
{%(py2)s = %(py0)s.stuff
} == %(py5)ss   assert %(py7)s(   s   ==(   s0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)ss   assert %(py7)s(   R   R[  t   stuffR   R3   R   R   R   R   R   R   R   R,   (	   R(   R   RØ   Rg  R   R   R   R   Rv   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_pyimport_bÂ  s$    	    |   	    |   c   	      C  sü   | j  d  } | j  d  j   } | j } d } | | k } | sê t j d | f d | | f  i t j |  d 6d t j   k s t j |  rŠ t j |  n d d 6t j |  d	 6} d i | d 6} t	 t j
 |    n  d  } } } d  S(   NRØ   s   c.pys   got its   ==s-   %(py2)s
{%(py2)s = %(py0)s.value
} == %(py5)sR   Rg  R   RE   R
   s   assert %(py7)sRC   (   s   ==(   s-   %(py2)s
{%(py2)s = %(py0)s.value
} == %(py5)ss   assert %(py7)s(   R   R[  t   valueR   R3   R   R   R   R   R   R   R   (	   R(   R   RØ   Rg  R   R   R   R   Rv   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_pyimport_cÈ  s    	    |   c   	      C  sü   | j  d  } | j  d  j   } | j } d } | | k } | sê t j d | f d | | f  i t j |  d 6d t j   k s t j |  rŠ t j |  n d d 6t j |  d	 6} d i | d 6} t	 t j
 |    n  d  } } } d  S(   NRØ   s   d.pys   got its   ==s.   %(py2)s
{%(py2)s = %(py0)s.value2
} == %(py5)sR   Rg  R   RE   R
   s   assert %(py7)sRC   (   s   ==(   s.   %(py2)s
{%(py2)s = %(py0)s.value2
} == %(py5)ss   assert %(py7)s(   R   R[  t   value2R   R3   R   R   R   R   R   R   R   (	   R(   R   RØ   Rg  R   R   R   R   Rv   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_pyimport_dÍ  s    	    |   c         C  sê  | j  d d  | j  d d  } | j   } | j } d } | | k } | sô t j d | f d | | f  i t j |  d 6d t j   k s¡ t j |  r° t j |  n d d	 6t j |  d
 6} d i | d 6} t	 t j
 |    n  d  } } } d d l m }	 |	 | k } | sàt j d | f d |	 | f  i d t j   k sft j |  rut j |  n d d 6d t j   k st j |	  r¬t j |	  n d d	 6}
 d i |
 d 6} t	 t j
 |    n  d  } d  S(   Nt
   xxxpackages   __init__.pys
   module1.pys   xxxpackage.module1s   ==s0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)sR   t   mod1R   RE   R
   s   assert %(py7)sRC   iÿÿÿÿ(   t   module1R   s   %(py0)s is %(py2)sRr  s   assert %(py4)sR   (   s   ==(   s0   %(py2)s
{%(py2)s = %(py0)s.__name__
} == %(py5)ss   assert %(py7)s(   R   (   s   %(py0)s is %(py2)ss   assert %(py4)s(   Rs   R[  R,   R   R3   R   R   R   R   R   R   R   Rp  Rr  (   R(   R   t   mod1pathRq  R   R   R   R   Rv   Rr  R6   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_pyimport_and_importÒ  s$    	    |        c         C  sn  d } t  t j j  } | j | d  } x2d D]*} | |  } | j | |  } t |  | _ | j t j	 | |  | j
   }	 | |	 k }
 |
 sVt j d |
 f d | |	 f  i d t j   k sÜ t j |	  rë t j |	  n d d	 6d
 t j   k st j |  r"t j |  n d
 d 6} d  i | d 6} t t j |    n  d  }
 q2 W| j   | |  } | j | d  } t |  | _ | j t j	 | |  t j j | j d  } | j j \ } } } | | k }
 |
 s©t j d! |
 f d" | | f  i d t j   k s/t j |  r>t j |  n d d	 6d t j   k sft j |  rut j |  n d d 6} d# i | d 6} t t j |    n  d  }
 | | k }
 |
 s}t j d$ |
 f d% | | f  i d t j   k st j |  rt j |  n d d	 6d t j   k s:t j |  rIt j |  n d d 6} d& i | d 6} t t j |    n  d  }
 | | k }
 |
 sQt j d' |
 f d( | | f  i d t j   k s×t j |  ræt j |  n d d	 6d t j   k st j |  rt j |  n d d 6} d) i | d 6} t t j |    n  d  }
 | j } t | t  } | s`d d i t j |  d 6d t j   k s°t j |  r¿t j |  n d d 6d t j   k sçt j t  röt j t  n d d 6t j |  d 6d t j   k s.t j t  r=t j t  n d d 6} t t j |    n  d  } } d  S(*   Nt   pointsback123s   .pys   .pycs	   $py.classs   .pyos   ==s   %(py0)s == %(py2)st   newmodR   Rg  R   R
   s   assert %(py4)sR   s   123.pys   p.pyimport()RÖ   Re  t
   pseudopatht   modfileR2   t   origs^   assert %(py6)s
{%(py6)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.ImportMismatchError
}, %(py4)s)
}R   R   t
   issubclassR   t   ImportError(   s   .pycs	   $py.classs   .pyo(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   t   typeRF   R   R   Rs   R   t   __file__t   setitemRú   t   modulesR[  R   R3   R   R   R   R   R   R   R   t   undoRj   Rk   R^  Rl  R   Rz  R{  (   R(   R   R   RÖ   t
   ModuleTypeR2   t   endingRg  Rw  Rv  R   R6   R7   t   excinfoRe  Rx  Ry  R   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt(   test_pyimport_check_filepath_consistencyÚ  s^         

	               	   Ó  c   	      C  s  | j  d d  } | j  d d d  } | j   } | j   } | | k } | st j d | f d | | f  i d t j   k s t j |  r¢ t j |  n d d 6d t j   k sÊ t j |  rÙ t j |  n d d	 6} d i | d 6} t t j	 |    n  d  } d  S(   Nt   projas   __init__.pyt   subs   ==s   %(py0)s == %(py2)st   m2R   t   m1R   R
   s   assert %(py4)sR   (   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   Rs   R[  R   R3   R   R   R   R   R   R   R   (	   R(   R   R  R	  R  R  R   R6   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt!   test_issue131_pyimport_on__init__ò  s         c         C  s€  | j  d  } | j d  } t |  } t j } | | k } | sXt j d | f d | | f  i t j |  d 6d t j	   k s t j
 |  rŠ t j |  n d d 6d t j	   k sÎ t j
 t  rÝ t j t  n d d 6t j |  d	 6d
 t j	   k st j
 t  r$t j t  n d
 d 6} d i | d 6} t t j |    n  d  } } } | j d d  t |  } t j d }	 | |	 k } | s}t j d | f d | |	 f  i t j |  d 6d t j	   k sót j
 |  rt j |  n d d 6d t j	   k s*t j
 t  r9t j t  n d d 6t j |	  d 6}
 d i |
 d 6} t t j |    n  d  } } }	 t |  } t j d  }	 | |	 k } | st j d | f d | |	 f  i t j |  d 6d t j	   k st j
 |  rt j |  n d d 6d t j	   k s?t j
 t  rNt j t  n d d 6t j |	  d 6}
 d  i |
 d 6} t t j |    n  d  } } }	 d  S(!   Nt   root1s   x123.pys   not insN   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} not in %(py7)s
{%(py7)s = %(py5)s.path
}R   R   R   R   RC   Rú   RE   R
   s   assert %(py9)sRG   t   ensuresyspathR   iÿÿÿÿs   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sR   s   assert %(py8)sR   s4   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} not in %(py6)s(   s   not in(   sN   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} not in %(py7)s
{%(py7)s = %(py5)s.path
}s   assert %(py9)s(   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   s   not in(   s4   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} not in %(py6)ss   assert %(py8)s(   t   mkdirRs   R   Rú   R)   R   R3   R   R   R   R   R   R   R   R[  (   R(   R   R  t   file1R   RN   R   Rv   R    R   R   R5   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_ensuresyspath_appendü  s6     	   ê       ³       ³   (   R,   R-   R\  R_  R`  Rd  Rf  Ri  Rk  Rm  Ro  Rt  R  R  R  (    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyRX    s   												
c         C  sÃ  |  j  d d d } | j  d  | j  d  | j } |   } | | k } | s/t j d | f d | | f  i t j |  d 6d	 t j   k s¥ t j |  rŽ t j |  n d	 d
 6d	 t j   k sÜ t j |  rë t j |  n d	 d 6t j |  d 6} d i | d 6} t t j	 |    n  d  } } } | j } d } d } | | |  } | j } |   }	 |	 | k }
 |
 s¡t j d |
 f d |	 | f  i d	 t j   k sÇt j |  rÖt j |  n d	 d 6t j |	  d 6t j |  d 6t j |  d 6d	 t j   k s.t j |  r=t j |  n d	 d
 6t j |  d 6t j |  d 6t j |  d 6} d i | d 6} t t j	 |    n  d  } } } } } }	 }
 d  S(   Nt   pkg1Ry   i   s   __init__.pys   subdir/__init__.pys   ==sH   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.pypkgpath
}()
} == %(py6)sR   t   pkgR   R   R   R
   s   assert %(py8)sR   R£   s   %(py12)s
{%(py12)s = %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s, %(py6)s)
}.pypkgpath
}()
} == %(py14)sR;   R<   R   s   assert %(py16)sR=   (   s   ==(   sH   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.pypkgpath
}()
} == %(py6)ss   assert %(py8)s(   s   ==(   s   %(py12)s
{%(py12)s = %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s, %(py6)s)
}.pypkgpath
}()
} == %(py14)ss   assert %(py16)s(   Rs   t	   pypkgpathR   R3   R   R   R   R   R   R   R   R   (   R   R  R   R   R   R   R5   R   R   RJ   RK   RL   RM   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_pypkgdir  s.    	 	   ³   	    	 	   ó   c         C  sX  |  j  d d d } | j  d  | j  d  j   } | j } |   } | | k } | s7t j d | f d | | f  i t j |  d 6d	 t j   k s­ t j |  rŒ t j |  n d	 d
 6d	 t j   k sä t j |  ró t j |  n d	 d 6t j |  d 6} d i | d 6} t	 t j
 |    n  d  } } } | j  } d } | |  } | j } |   }	 |	 | k }
 |
 st j d |
 f d |	 | f  i d	 t j   k sÆt j |  rÕt j |  n d	 d 6t j |	  d 6t j |  d 6d	 t j   k st j |  r,t j |  n d	 d
 6t j |  d 6t j |  d 6t j |  d 6} d i | d 6} t	 t j
 |    n  d  } } } } }	 }
 | j } |   } | } | sFd d i t j |  d 6d t j   k st j |  rt j |  n d d
 6t j |  d 6} t	 t j
 |    n  d  } } } d  S(   Ns   pkg1-1Ry   i   s   __init__.pys   subdir/__init__.pys   ==sH   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.pypkgpath
}()
} == %(py6)sR   R£   R   R   R   R
   s   assert %(py8)sR   s   xyz.pys   %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.ensure
}(%(py4)s)
}.pypkgpath
}()
} == %(py12)sR<   R   s   assert %(py14)sR;   sH   assert not %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.pypkgpath
}()
}R  (   s   ==(   sH   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.pypkgpath
}()
} == %(py6)ss   assert %(py8)s(   s   ==(   s   %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.ensure
}(%(py4)s)
}.pypkgpath
}()
} == %(py12)ss   assert %(py14)s(   Rs   RI   R  R   R3   R   R   R   R   R   R   R   (   R   R  R£   R   R   R   R   R5   R   R   RJ   R®   RL   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_pypkgdir_unimportable  s:    	 	   ³   	   	 	   ã   	 	   e  c          C  s-  d d l  m }  d } |  |  } | } | s¬ d d i t j |  d 6d t j   k sj t j |   ry t j |   n d d 6t j |  d 6} t t j |    n  d  } } } d	 } |  |  } | sOd d
 i t j |  d 6d t j   k st j |   rt j |   n d d 6t j |  d 6} t t j |    n  d  } } d } |  |  } | sîd d
 i t j |  d 6d t j   k s¬t j |   r»t j |   n d d 6t j |  d 6} t t j |    n  d  } } d } |  |  } | sd d
 i t j |  d 6d t j   k sKt j |   rZt j |   n d d 6t j |  d 6} t t j |    n  d  } } d } |  |  } | s,d d
 i t j |  d 6d t j   k sêt j |   rùt j |   n d d 6t j |  d 6} t t j |    n  d  } } d } |  |  } | sËd d
 i t j |  d 6d t j   k st j |   rt j |   n d d 6t j |  d 6} t t j |    n  d  } } d } |  |  } | } | sqd d i t j |  d 6d t j   k s/t j |   r>t j |   n d d 6t j |  d 6} t t j |    n  d  } } } d } |  |  } | } | sd d i t j |  d 6d t j   k sÙt j |   rèt j |   n d d 6t j |  d 6} t t j |    n  d  } } } d  S(   Niÿÿÿÿ(   t   isimportableR
   s0   assert not %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}R   R  R   R   R¥   s,   assert %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}t   x1t   x_1t   _t   _1s   x-1s   x:1(
   t   py._path.localR  R   R   R   R   R   R   R   R   (   R  R   R   R   R   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_isimportable  sh        e     e  
   e  
   e  
   e  
   e  
    e      e  c         C  s  t  j   } |  j d |  t j } | j } | j } |   } t j } | j } | |  } | | k }	 |	 rÞt j d f |	 f d f | | f  i
 t j	 |  d 6d t
 j   k pÆ t j |  rØ t j	 |  n d d 6t j	 |  d 6t j	 |  d 6d	 t
 j   k pt j t  r/t j	 t  n d	 d
 6t j	 |  d 6d	 t
 j   k pdt j t  rvt j	 t  n d	 d 6t j	 |  d 6t j	 |  d 6t j	 |  d 6}
 d d i |
 d 6} t t j |    n  t } } } } }	 } } } d  S(   NRª   s   ==sÚ   %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.path
}.local
}._gethomedir
}()
} == %(py17)s
{%(py17)s = %(py14)s
{%(py14)s = %(py12)s
{%(py12)s = %(py10)s.path
}.local
}(%(py15)s)
}R?   R)   R@   R;   R<   RF   R   R   R   R   R   R   R
   s   assert %(py19)sRH   (   R   R   R­   RF   R)   R   t   _gethomedirR   R3   R   R   R   R   R   R   R   (   R   R)   R   R   R   R   RJ   RK   RR   R   RT   RU   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_homedir_from_HOME  s     	 	 	 	 	 	    ÿ A   c         C  s  |  j  d d t |  j  d d t t j j j   } | d  k } | st j d | f d | d  f  i d t	 j
   k s t j d   r t j d   n d d 6d t	 j
   k sÃ t j |  rÒ t j |  n d d	 6} d i | d 6} t t j |    n  d  } d  S(   NRª   t   raisingt	   HOMEDRIVER   s   %(py0)s is %(py2)sR   R   t   homedirR   R
   s   assert %(py4)sR   (   R   (   s   %(py0)s is %(py2)ss   assert %(py4)s(   t   delenvR   RF   R)   R   R  R   R   R3   R   R   R   R   R   R   (   R   R  R   R6   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_homedir_not_exists$  s         c   	      C  sõ  |  j  } | |   } | sÏ d d i d t j   k sF t j |   rU t j |   n d d 6t j |  d 6d t j   k s t j |   r t j |   n d d 6t j |  d 6} t t j |    n  d  } } |  j	 d  } | j  } | |  } | s·d d i d	 t j   k s.t j |  r=t j |  n d	 d 6t j |  d 6d	 t j   k sut j |  rt j |  n d	 d 6t j |  d 6} t t j |    n  d  } } | j
   j   û | j  } | j } | |  } | sŒd d
 i d	 t j   k s#t j |  r2t j |  n d	 d 6t j |  d 6d	 t j   k sjt j |  ryt j |  n d	 d 6t j |  d 6t j |  d 6} t t j |    n  d  } } } Wd  QXt j d k rñ| j t |  j    } | j t |  j    } | j  } | |  } | säd d i d t j   k s[t j |  rjt j |  n d d 6t j |  d 6d t j   k s¢t j |  r±t j |  n d d 6t j |  d 6} t t j |    n  d  } } n  d  S(   NR
   sJ   assert %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.samefile
}(%(py3)s)
}R   R   R   R   RE   R\   R2   sh   assert %(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.samefile
}(%(py5)s
{%(py5)s = %(py3)s.basename
})
}RC   Rù   R	  R  (   t   samefileR   R   R   R   R   R   R   R   Rs   RI   RŠ   R4   Rú   Rû   t	   __class__R   t   lowert   upper(	   R   R   R   R   R2   RN   Rv   R  R	  (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_samefile*  s<    	     
	     
	 	   ¬  	     c         C  sÕ   |  j  d  |  j d  d } | j } d } | | k } | s¿ t j d | f d | | f  i t j |  d 6t j |  d 6t j |  d 6} d i | d
 6} t t j |    n  d  } } } } d  S(   NR\   i    s   ==s0   %(py3)s
{%(py3)s = %(py1)s.basename
} == %(py6)sR   R   R   R
   s   assert %(py8)sR   (   s   ==(   s0   %(py3)s
{%(py3)s = %(py1)s.basename
} == %(py6)ss   assert %(py8)s(	   Rs   R;  R4   R   R3   R   R   R   R   (   R   R   R   R   R   R   R5   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_listdir_single_arg5  s     	    U   c         C  s
  t  j d |   } |  j } |   } | g } | | k } | sô t j d | f d | | f  i t j |  d 6d t j   k s t j |   r  t j |   n d d 6t j |  d 6t j |  d 6} d i | d 6} t	 t j
 |    n  d  } } } } d  S(   NRD  s   ==sF   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.listdir
}()
} == %(py7)sR   R   R   RC   R   R
   s   assert %(py9)sRG   (   s   ==(   sF   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.listdir
}()
} == %(py7)ss   assert %(py9)s(   R   RÝ   R;  R   R3   R   R   R   R   R   R   R   (   R   t   dtmpR   R   RN   R   Rv   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_mkdtemp_rootdir9  s    	 	 	      t   TestWINLocalPathc           B  sM   e  Z e Z d    Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(   c         C  s*   t  j j t d  t  j j t d  d  S(   Ns   path1.stat().owners   path1.stat().group(   RF   Rj   Rk   RN  (   R(   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt    test_owner_group_not_implemented@  s    c   	   	   C  sÃ  t  j j d |  | j   j } | j | d k r: d p= d  zB| j   j GH| GH| j } |   } | j } | | k } | spt j d | f d | | f  i t j |  d 6d t	 j
   k sÖ t j |  rå t j |  n d d 6d	 t	 j
   k st j |  rt j |  n d	 d
 6t j |  d 6t j |  d 6} d i | d 6} t t j |    n  d  } } } } Wd  | j |  | j } |   } | j } | | k } | s¬t j d | f d | | f  i t j |  d 6d t	 j
   k st j |  r!t j |  n d d 6d	 t	 j
   k sIt j |  rXt j |  n d	 d
 6t j |  d 6t j |  d 6} d i | d 6} t t j |    n  d  } } } } Xd  S(   Ns   path1 isi    i   s   !=s]   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stat
}()
}.mode
} != %(py8)sR   R   R   R^   R   R   R   R
   s   assert %(py10)sR   s   ==s]   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stat
}()
}.mode
} == %(py8)s(   s   !=(   s]   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stat
}()
}.mode
} != %(py8)ss   assert %(py10)s(   s   ==(   s]   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stat
}()
}.mode
} == %(py8)ss   assert %(py10)s(   RF   Rc   t   print_t   statR^   Rt   R   R3   R   R   R   R   R   R   R   (	   R(   R   R^   R   R   R   R   R5   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_chmod_simple_intD  s2    	 	 	   Ã   	 	 	   Ã   c         C  sÊ  | j  d  } | j  d  } | | k } | sì t j d | f d | | f  i d t j   k sr t j |  r t j |  n d d 6d t j   k s© t j |  rž t j |  n d d 6} d i | d
 6} t t j |    n  d  } | | k } | sÀt j d | f d | | f  i d t j   k sFt j |  rUt j |  n d d 6d t j   k s}t j |  rt j |  n d d 6} d i | d
 6} t t j |    n  d  } d  S(   Nt   a_patht   A_paths   ==s   %(py0)s == %(py2)st   t1R   R   R
   s   assert %(py4)sR   t   t2(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(
   R   R   R3   R   R   R   R   R   R   R   (   R(   R   R±  R²  R   R6   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt$   test_path_comparison_lowercase_mixedQ  s              c   
      C  sP  | j  d d  } | j  d  } | j } | |  } d } | | k } | s:t j d | f d | | f  i d t j   k s t j |  r t j |  n d d 6t j |  d 6d	 t j   k s× t j |  ræ t j |  n d	 d
 6t j |  d 6t j |  d 6} d i | d 6}	 t t j	 |	    n  d  } } } } d  S(   NR¯  t   fiLeR°  s   ==sK   %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.relto
}(%(py3)s)
} == %(py8)sR²  R   R   R±  R   R   RE   R
   s   assert %(py10)sR   (   s   ==(   sK   %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.relto
}(%(py3)s)
} == %(py8)ss   assert %(py10)s(   R   RQ  R   R3   R   R   R   R   R   R   R   (
   R(   R   R±  R²  R   R   R   RN   R5   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_relto_with_mixed_caseW  s    	     Ã   c   	      C  s*  | j  d  } t |  } d } | | } | | k } | sPt j d | f d | | f  i d t j   k s t j |  r t j |  n d d 6d t j   k s¶ t j t  rÅ t j t  n d d 6d	 t j   k sí t j |  rü t j |  n d	 d
 6t j |  d 6t j |  d 6} d i | d 6} t t j	 |    n  d  } } } } | j  d  } t |  } d } | | } | | k } | s²t j d | f d | | f  i d t j   k sát j |  rðt j |  n d d 6d t j   k st j t  r't j t  n d d 6d	 t j   k sOt j |  r^t j |  n d	 d
 6t j |  d 6t j |  d 6} d i | d 6} t t j	 |    n  d  } } } } | j  d  } t |  } d } | | } | | k } | st j d | f d | | f  i d t j   k sCt j |  rRt j |  n d d 6d t j   k szt j t  rt j t  n d d 6d	 t j   k s±t j |  rÀt j |  n d	 d
 6t j |  d 6t j |  d 6} d i | d 6} t t j	 |    n  d  } } } } d  S(   NR¯  s   \a_paths   ==s<   %(py0)s == (%(py5)s
{%(py5)s = %(py2)s(%(py3)s)
} + %(py7)s)R   R   R   R   R±  R   RC   RE   R
   s   assert %(py10)sR   s   a_path/s
   dir/a_paths   \dir\a_path(   s   ==(   s<   %(py0)s == (%(py5)s
{%(py5)s = %(py2)s(%(py3)s)
} + %(py7)s)s   assert %(py10)s(   s   ==(   s<   %(py0)s == (%(py5)s
{%(py5)s = %(py2)s(%(py3)s)
} + %(py7)s)s   assert %(py10)s(   s   ==(   s<   %(py0)s == (%(py5)s
{%(py5)s = %(py2)s(%(py3)s)
} + %(py7)s)s   assert %(py10)s(   R   R   R   R3   R   R   R   R   R   R   R   (	   R(   R   R±  R   RN   RS   R   R5   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_allow_unix_style_paths\  s<      
   ê     
   ê     
   ê   c   	      C  s!  t  j j j d  } | j d d d d  } | j   â t  j j j | j |   } | j } d } | d |  } | s	d d i t j	 |  d 6d	 t
 j   k s· t j |  rÆ t j	 |  n d	 d
 6t j	 |  d 6t j	 |  d 6} t t j |    n  d  } } } Wd  QXd  S(   NR  t   dirnameR
   R4   i   RŸ   sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(file=%(py4)s)
}R   R¥   R   R   R   (   RF   R)   R   R  RL  RŠ   RQ  R   R   R   R   R   R   R   R   R   (	   R(   R   R  t   rootR¥   R   R   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_sysfind_in_currentdird  s    	    u  c         C  si  d d  l  } | j d d  } | j } | j } | j } d } | |  } | |  }	 |	 sQd d i t j |	  d 6t j |  d 6d	 t j   k sš t j |  r· t j |  n d	 d
 6t j |  d 6d t j   k sï t j |  rþ t j |  n d d 6t j |  d 6t j |  d 6t j |  d 6}
 t	 t j
 |
    n  d  } } } } } }	 | j j t |  d d g  } | j } | |  } | s[d d i d t j   k sÒt j |  rát j |  n d d
 6t j |  d 6d t j   k st j |  r(t j |  n d d 6t j |  d 6} t	 t j
 |    n  d  } } d  S(   NiÿÿÿÿRÿ   R  R  R
   s   assert %(py13)s
{%(py13)s = %(py2)s
{%(py2)s = %(py0)s.fnmatch
}(%(py11)s
{%(py11)s = %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.sep
}.join
}(%(py9)s)
})
}RA   RB   t	   posixpathR   R   R   RC   RE   RG   R  sI   assert %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.fnmatch
}(%(py3)s)
}R  (   Rº  R   R  R  R   R   R   R   R   R   R   R   R   (   R(   R   Rº  R  R   R   RN   RS   RO   RP   Rã   R  R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt0   test_fnmatch_file_abspath_posix_pattern_on_win32k  s&    	 	 	     Ü  !	     (   R,   R-   R.  R/  R«  R®  R³  Rµ  R¶  R¹  R»  (    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyRª  =  s   						t   TestPOSIXLocalPathc           B  s%  e  Z 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 e j j d e d d  d    Z d   Z d   Z e d    Z  e d    Z! e d    Z" RS(   c         C  s  | j  d  } | j  d  } | j d  | j   j } | j |  | j } |   } | j } d } | | }	 | |	 k }
 |
 st j d |
 f d | |	 f  i t j |  d 6t j |  d 6d	 t j	   k sæ t j
 |  rõ t j |  n d	 d
 6t j |  d 6t j |  d 6d t j	   k s=t j
 |  rLt j |  n d d 6} d i | d 6} t t j |    n  d  } } } }
 } }	 d  S(   NRj   RŸ   t   Helloi   s   ==sk   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stat
}()
}.nlink
} == (%(py8)s + %(py10)s)R   R   t   filepathR   R   R   t   nlinkR   R
   s   assert %(py13)sRA   (   s   ==(   sk   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stat
}()
}.nlink
} == (%(py8)s + %(py10)s)s   assert %(py13)s(   R   Rg   R­  R¿  t   mklinktoR   R3   R   R   R   R   R   R   R   (   R(   R   t   linkpathRŸ  R¿  R   R   R   R   RJ   R   R¡   Rã   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_hardlinkw  s     	 	 	  
   Ó   c   
      C  s¬  | j  d  } | j d  | j  d  } | j |  | j } |   } t |  } | | k } | rt j d f | f d f | | f  i t j |  d 6d t j	   k pŸ t j
 |  rÐ t j |  n d d 6d	 t j	   k põ t j
 |  rt j |  n d	 d
 6d t j	   k p,t j
 t  r>t j t  n d d 6t j |  d 6t j |  d 6} d d i | d 6}	 t t j |	    n  t } } } } d  S(   NRŸ   Rœ  Rj   s   ==se   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.readlink
}()
} == %(py9)s
{%(py9)s = %(py6)s(%(py7)s)
}R   RÁ  R   RŸ  RC   R   R   R   RG   R
   s   assert %(py11)sRB   (   R   Rg   t   mksymlinktot   readlinkR   R   R3   R   R   R   R   R   R   R   (
   R(   R   RŸ  RÁ  R   R   RS   R   R    R¡   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_symlink_are_identical  s    	 	    ÿ    c         C  s  | j  d  } | j  d  } | j d  | j |  | j } d } | d |  } | sé d d i t j |  d 6d t j   k s t j |  rŠ t j |  n d d 6t j |  d	 6t j |  d
 6} t	 t j
 |    n  d  } } } | j } d } d } | d | d |  } | }	 |	 sËd d i t j |  d 6d t j   k sit j |  rxt j |  n d d 6t j |  d 6t j |  d	 6t j |  d
 6}
 t	 t j
 |
    n  d  } } } } }	 | j } |   } | svd d i t j |  d 6d t j   k s4t j |  rCt j |  n d d 6t j |  d
 6} t	 t j
 |    n  d  } } d  S(   NRj   RŸ   R
   i   sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(file=%(py4)s)
}R   RÁ  R   R   R   i    t   links^   assert not %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.check
}(link=%(py4)s, file=%(py6)s)
}R   sA   assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.islink
}()
}(   R   Rg   RÃ  R   R   R   R   R   R   R   R   R   t   islink(   R(   R   RÁ  RŸ  R   R   R   R   R   R   R    R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_symlink_isfile  s4    	    u  	        	 	  e  c         C  s{  | j  d  } | j  d  } | j d  | j | d t | j } |   } d } | | k } | st j d | f d | | f  i t j |  d 6d t j	   k sº t j
 |  rÉ t j |  n d d	 6t j |  d
 6t j |  d 6} d i | d 6}	 t t j |	    n  d  } } } } | j } |   } | j }
 |
   } | | k } | sat j d | f d | | f  i t j |  d 6t j |  d 6d t j	   k sÇt j
 |  rÖt j |  n d d	 6d t j	   k sþt j
 |  rt j |  n d d 6t j |  d 6t j |
  d 6} d i | d 6} t t j |    n  d  } } } }
 } d  S(   NRj   RŸ   Rœ  t   absolutes   ==sG   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.readlink
}()
} == %(py7)sR   RÁ  R   RC   R   R
   s   assert %(py9)sRG   sv   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s.read
}()
}R   RŸ  R   R   s   assert %(py12)sR<   (   s   ==(   sG   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.readlink
}()
} == %(py7)ss   assert %(py9)s(   s   ==(   sv   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s.read
}()
}s   assert %(py12)s(   R   Rg   RÃ  R   RÄ  R   R3   R   R   R   R   R   R   R   RÁ   (   R(   R   RÁ  RŸ  R   R   RN   R   Rv   R    R   R   R    R®   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_symlink_relative  s.    	 	       	 	 	 	   Ó   c   	      C  s  | j  d  } | j } d } | d |  } | } | sÇ d d i t j |  d 6d t j   k su t j |  r t j |  n d d 6t j |  d	 6t j |  d
 6} t t j |    n  d  } } } } | j } d } | d |  } | sd d i t j |  d 6d t j   k s8t j |  rGt j |  n d d 6t j |  d	 6t j |  d
 6} t t j |    n  d  } } } d  S(   Nt   testnotexistingi   RÆ  R
   sP   assert not %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(link=%(py4)s)
}R   RÁ  R   R   R   i    sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(link=%(py4)s)
}(
   R   R   R   R   R   R   R   R   R   R   (	   R(   R   RÁ  R   R   R   R   Rv   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_symlink_not_existing  s     	     u  	    u  c   	      C  sÐ   | j  d  j t j j d   } | d } t |  d } | | k } | sŸ t j d | f d | | f  i t j |  d 6t j |  d 6} d i | d 6} t	 t j
 |    n  d  } } } d  S(   NR¥   t   /i    i   s   ==s   %(py1)s == %(py4)sR   R   R
   s   assert %(py6)sR   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R   RQ  RF   R)   R   R   R   R3   R   R   R   R   (	   R(   R   R   R4  R   R   R   R7   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_relto_with_root  s    $
    E   c   	      C  sF  | j  d  } | j |  | j d  d    } t |  } | g } | | k } | s4t j d | f d | | f  i t j |  d 6d t j	   k sª t j
 |  r¹ t j |  n d d 6d t j	   k sá t j
 t  rð t j t  n d d	 6t j |  d
 6} d i | d 6} t t j |    n  d  } } } d  S(   NRj   c         S  s   |  j  d d  S(   NRÆ  i    (   R   (   R¥   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR   £  s    s   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sR   t   visitorR   R  R   R   R
   s   assert %(py8)sR   (   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   R   RÃ  R  R   R  R   R3   R   R   R   R   R   R   (	   R(   R   RÁ  RÏ  R   R   R   R   R5   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_visit_recursive_symlink   s     	   ³   c   
      C  sÉ  | j  d  } | j |  | j } d } | d |  } | sÍ d d i t j |  d 6d t j   k s{ t j |  r t j |  n d d 6t j |  d	 6t j |  d
 6} t t j	 |    n  d  } } } | j } d } d } | d | d |  } | } | s¯d d i t j |  d 6d t j   k sMt j |  r\t j |  n d d 6t j |  d 6t j |  d	 6t j |  d
 6}	 t t j	 |	    n  d  } } } } } d  S(   NRj   i   Ry   R
   sK   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(dir=%(py4)s)
}R   RÁ  R   R   R   i    RÆ  s]   assert not %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.check
}(link=%(py4)s, dir=%(py6)s)
}R   (   R   RÃ  R   R   R   R   R   R   R   R   R   (
   R(   R   RÁ  R   R   R   R   R   R   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_symlink_isdirŠ  s$    	    u  	        c         C  s  | j  d  } | j |  | j } d } | d |  } | sÍ d d i t j |  d 6d t j   k s{ t j |  r t j |  n d d 6t j |  d	 6t j |  d
 6} t t j	 |    n  d  } } } | j   | j } |   } | } | sd d i t j |  d 6d t j   k s?t j |  rNt j |  n d d 6t j |  d
 6} t t j	 |    n  d  } } } d  S(   NRj   i   RÆ  R
   sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(link=%(py4)s)
}R   RÁ  R   R   R   sD   assert not %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}(   R   RÃ  R   R   R   R   R   R   R   R   R   Ru   (   R(   R   RÁ  R   R   R   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_symlink_remove¬  s"    	    u  
	 	   e  c   
      C  s  | j  d  } | j  d  } | j d  | j |  | j   } | j } d } | | k } | s
t j d | f d | | f  i t j |  d 6d t j	   k s· t j
 |  rÆ t j |  n d d 6t j |  d	 6} d i | d 6}	 t t j |	    n  d  } } } d  S(   NRj   RŸ   R
   s   ==s0   %(py2)s
{%(py2)s = %(py0)s.basename
} == %(py5)sR   t   realpathR   RE   s   assert %(py7)sRC   (   s   ==(   s0   %(py2)s
{%(py2)s = %(py0)s.basename
} == %(py5)ss   assert %(py7)s(   R   Rg   RÃ  RÓ  R4   R   R3   R   R   R   R   R   R   R   (
   R(   R   RÁ  RŸ  RÓ  R   R   R   R   Rv   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_realpath_file³  s    	    |   c         C  s  d d l  m } d d l m } | j   } | j } | | k } | st j d | f d | | f  i t j |  d 6d t	 j
   k s t j |  rš t j |  n d d 6d	 t	 j
   k sÐ t j |  rß t j |  n d	 d
 6} d i | d 6}	 t t j |	    n  d  } } | j }
 | j } | |
  d } | |  d } | j } |
 | k } | s6t j d | f d |
 | f  i d t	 j
   k s¬t j |  r»t j |  n d d 6d t	 j
   k sãt j |
  ròt j |
  n d d 6t j |  d
 6} d i | d 6}	 t t j |	    n  d  } } | j } | | k } | s't j d | f d | | f  i d t	 j
   k st j |  r¬t j |  n d d 6d t	 j
   k sÔt j |  rãt j |  n d d 6t j |  d
 6} d i | d 6}	 t t j |	    n  d  } } | j } | | k } | st j d  | f d! | | f  i d t	 j
   k st j |  rt j |  n d d 6d t	 j
   k sÅt j |  rÔt j |  n d d 6t j |  d
 6} d" i | d 6}	 t t j |	    n  d  } } | j } | | k } | s	t j d# | f d$ | | f  i d t	 j
   k st j |  rt j |  n d d 6d t	 j
   k s¶t j |  rÅt j |  n d d 6t j |  d
 6} d% i | d 6}	 t t j |	    n  d  } } d  S(&   Niÿÿÿÿ(   t   getpwuid(   t   getgrgids   ==s,   %(py2)s
{%(py2)s = %(py0)s.path
} == %(py4)sR   R­  R   R   R   R
   s   assert %(py6)sR   i    s+   %(py0)s == %(py4)s
{%(py4)s = %(py2)s.uid
}t   uids-   %(py0)s == %(py4)s
{%(py4)s = %(py2)s.owner
}t   owners+   %(py0)s == %(py4)s
{%(py4)s = %(py2)s.gid
}t   gids-   %(py0)s == %(py4)s
{%(py4)s = %(py2)s.group
}t   group(   s   ==(   s,   %(py2)s
{%(py2)s = %(py0)s.path
} == %(py4)ss   assert %(py6)s(   s   ==(   s+   %(py0)s == %(py4)s
{%(py4)s = %(py2)s.uid
}s   assert %(py6)s(   s   ==(   s-   %(py0)s == %(py4)s
{%(py4)s = %(py2)s.owner
}s   assert %(py6)s(   s   ==(   s+   %(py0)s == %(py4)s
{%(py4)s = %(py2)s.gid
}s   assert %(py6)s(   s   ==(   s-   %(py0)s == %(py4)s
{%(py4)s = %(py2)s.group
}s   assert %(py6)s(   t   pwdRÕ  t   grpRÖ  R­  R)   R   R3   R   R   R   R   R   R   R   R×  RÙ  RØ  RÚ  (   R(   R   R   RÕ  RÖ  R­  R   R   R7   R   R×  RÙ  RØ  RÚ  (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt
   test_owner»  sT    	   £   
			   £   
	   £   
	   £   
	   £   c         C  sœ  | j  d  } | j   } | j   } | j } |   } | sŒ d d i t j |  d 6d t j   k sz t j |  r t j |  n d d 6t j |  d 6} t t j	 |    n  d  } } | j } |   } | s[d d i t j |  d 6d	 t j   k st j |  r(t j |  n d	 d 6t j |  d 6} t t j	 |    n  d  } } | j } |   } | }	 |	 sd d
 i t j |  d 6d t j   k s¿t j |  rÎt j |  n d d 6t j |  d 6}
 t t j	 |
    n  d  } } }	 | j } |   } | }	 |	 s«d d
 i t j |  d 6d	 t j   k sit j |  rxt j |  n d	 d 6t j |  d 6}
 t t j	 |
    n  d  } } }	 d  S(   NRŸ   R
   sA   assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.isfile
}()
}R   t   stat1R   R   s@   assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.isdir
}()
}t   stat2sE   assert not %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.islink
}()
}(   Rs   R­  t   isfileR   R   R   R   R   R   R   R   t   isdirRÇ  (   R(   R   R   R   RÞ  Rß  R   R   R7   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_stat_helpersË  s:    	 	  e  
	 	  e  
	 	   e  	 	   e  c           s  | j  d    t j t j j   f d      j d t  } | d  k } | st	 j
 d | f d | d  f  i d t j   k s t	 j d   r£ t	 j d   n d d 6d t j   k sË t	 j |  rÚ t	 j |  n d d	 6} d i | d 6} t t	 j |    n  d  } d  S(   NRŸ   c             s
     j    S(   N(   R­  (    (   R   (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR   Ö  s    R  R   s   %(py0)s is %(py2)sR   R   Râ   R   R
   s   assert %(py4)sR   (   R   (   s   %(py0)s is %(py2)ss   assert %(py4)s(   R   R   Rk   RF   R   R   R­  R   R   R   R3   R   R   R   R   R   R   (   R(   R   Râ   R   R6   R7   (    (   R   s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_stat_non_raisingÔ  s         c         C  s  d d  l  } | j d  } | j    } | j   } | j   | j t  | j   } | j t  | j    | } | | } | | k }	 |	 st j d |	 f d | | f  i d t j	   k sÑ t j
 |  rà t j |  n d d 6d t j	   k st j
 |  rt j |  n d d 6d	 t j	   k s?t j
 |  rNt j |  n d	 d
 6}
 d i |
 d 6} t t j |    n  d  } }	 d  S(   NiÿÿÿÿR	   s   <=s   (%(py0)s - %(py1)s) <= %(py4)st   atime1R   t   atime2R   t   durationR   R
   s   assert %(py6)sR   (   s   <=(   s   (%(py0)s - %(py1)s) <= %(py4)ss   assert %(py6)s(   RÐ   Rs   t   atimeRÁ   t   sleept   ATIME_RESOLUTIONR   R3   R   R   R   R   R   R   R   (   R(   R   RÐ   R)   t   nowRä  Rå  Ræ  R   R   R7   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt
   test_atimeÚ  s     

   Ê   c   	      C  s²  | j  d  } | j  d  } | j } | |  } | | k } | sXt j d | f d | | f  i d t j   k s t j |  r t j |  n d d 6t j |  d 6d t j   k sÎ t j |  rÝ t j |  n d d	 6d
 t j   k st j |  rt j |  n d
 d 6t j |  d 6} d i | d 6} t t j	 |    n  d  } } } | j } | |  } | | k } | s t j d | f d | | f  i d t j   k sÏt j |  rÞt j |  n d d 6t j |  d 6d t j   k st j |  r%t j |  n d d	 6d
 t j   k sMt j |  r\t j |  n d
 d 6t j |  d 6} d i | d 6} t t j	 |    n  d  } } } d  S(   Nt	   somethingt
   otherthings   ==sL   %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.common
}(%(py3)s)
} == %(py7)sR	  R   R   R  R   R   RC   RE   R
   s   assert %(py9)sRG   (   s   ==(   sL   %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.common
}(%(py3)s)
} == %(py7)ss   assert %(py9)s(   s   ==(   sL   %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.common
}(%(py3)s)
} == %(py7)ss   assert %(py9)s(   R   R   R   R3   R   R   R   R   R   R   R   (	   R(   R   R  R	  R   R   RN   Rv   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_commondirè  s$    	    ê   	    ê   c   
      C  sW  | j  d  } t j j | j d  } | j } | |  } d } | | k } | sAt j d | f d | | f  i d t j	   k s t j
 |  rŠ t j |  n d d 6t j |  d 6d	 t j	   k sÞ t j
 |  rí t j |  n d	 d
 6t j |  d 6t j |  d 6} d i | d 6}	 t t j |	    n  d  } } } } d  S(   NRì  t   blablaRÍ  s   ==sL   %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.common
}(%(py3)s)
} == %(py8)sR	  R   R   R  R   R   RE   R
   s   assert %(py10)sR   (   s   ==(   sL   %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.common
}(%(py3)s)
} == %(py8)ss   assert %(py10)s(   R   RF   R)   R   R  R   R   R3   R   R   R   R   R   R   R   (
   R(   R   R  R	  R   R   R   RN   R5   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_commondir_nocommonð  s    	     Ã   c         C  sô  | j    d } t |  } t |  } d } | | k } | rnt j d f | f d f | | f  i d t j   k p t j |  r t j |  n d d 6d t j   k pœ t j t  rÏ t j t  n d d 6d	 t j   k pô t j t  rt j t  n d	 d
 6t j |  d 6t j |  d 6t j |  d 6} d d i | d 6} t	 t j
 |    n  t } } } } | j }	 d }
 |	 |
  } t |  } d } | | k } | rÖt j d f | f d f | | f  i t j |  d 6t j |	  d 6d t j   k p%t j |  r7t j |  n d d 6d t j   k p\t j t  rnt j t  n d d
 6t j |  d 6t j |
  d 6t j |  d 6} d d i | d 6} t	 t j
 |    n  t }	 }
 } } } } d  S(   Ni    i   s   ==sN   %(py6)s
{%(py6)s = %(py0)s(%(py4)s
{%(py4)s = %(py1)s(%(py2)s)
})
} == %(py9)sRž  R   R   R   R  R   R   R   RG   R
   s   assert %(py11)sRB   Rÿ   s   //asi   %(py9)s
{%(py9)s = %(py0)s(%(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.join
}(%(py5)s)
})
} == %(py12)sR<   R   RC   RE   s   assert %(py14)sR;   (   t   partsR   R  R   R3   R   R   R   R   R   R   R   R   (   R(   R   Rž  R   R   RS   R   R    R¡   R   R   RN   RJ   RO   R®   RL   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_join_to_root÷  s,         ÿ    	       é   c         C  s  | j  d  } t |  } t |  } | | k } | rt j d f | f d f | | f  i t j |  d 6d t j   k p t j |  r¡ t j |  n d d 6d t j   k pÆ t j t  rØ t j t  n d d 6d	 t j   k pý t j |  rt j |  n d	 d
 6d t j   k p4t j t  rFt j t  n d d 6t j |  d 6} d d i | d 6} t t j	 |    n  t
 } } } | | k } | rut j d f | f d f | | f  i d	 t j   k pôt j |  rt j |  n d	 d 6d t j   k p+t j |  r=t j |  n d d 6}	 d d i |	 d 6}
 t t j	 |
    n  t
 } d  S(   NRÍ  s   ==sN   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py8)s
{%(py8)s = %(py5)s(%(py6)s)
}R   R   R   R   R   t   nrootR   RE   R   R
   s   assert %(py10)sR   s   %(py0)s == %(py2)sR   s   assert %(py4)sR   (   R   R   R   R3   R   R   R   R   R   R   R   (   R(   R   Ró  R   R   R   R5   R    R   R6   R7   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt"   test_join_root_to_root_with_no_absü  s         ÿ (        c   	   	   C  s  | j    j } | j t | d   z/| j  } |   } | j } | | k } | sBt j d | f d | | f  i t j |  d 6d t j   k sš t j	 |  r· t j |  n d d 6d t j   k sß t j	 |  rî t j |  n d d 6t j |  d	 6t j |  d
 6} d i | d 6} t
 t j |    n  d  } } } } Wd  | j |  | j  } |   } | j } | | k } | s~t j d | f d | | f  i t j |  d 6d t j   k sät j	 |  rót j |  n d d 6d t j   k st j	 |  r*t j |  n d d 6t j |  d	 6t j |  d
 6} d i | d 6} t
 t j |    n  d  } } } } Xd  S(   Ni   s   !=s]   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stat
}()
}.mode
} != %(py8)sR   R   R   R^   R   R   R   R
   s   assert %(py10)sR   s   ==s]   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stat
}()
}.mode
} == %(py8)s(   s   !=(   s]   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stat
}()
}.mode
} != %(py8)ss   assert %(py10)s(   s   ==(   s]   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stat
}()
}.mode
} == %(py8)ss   assert %(py10)s(   R­  R^   Rt   R|   R   R3   R   R   R   R   R   R   R   (	   R(   R   R^   R   R   R   R   R5   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR®    s,    	 	 	   Ã   	 	 	   Ã   c         C  s×  d   } i  } x- | j  d |  D] } | j   j | | <q" W| j t d d  d | zJxC| j  d |  D]/} | j } |   } | j } d } d }	 t | |	  }
 | |
 @} d } d } t | |  } | | k } | rrt j d f | f d f | | f  i t j |  d 6t j |  d	 6t j |  d
 6d t j	   k pZt j
 t  rlt j t  n d d 6t j |
  d 6t j |	  d 6t j |  d 6d t j	   k pÁt j
 |  rÓt j |  n d d 6d t j	   k pøt j
 t  r
t j t  n d d 6t j |  d 6t j |  d 6t j |  d 6} d d i | d 6} t t j |    n  t } } } } }	 }
 } } } } } qq WWd  x' | j   D] \ } } | j |  qµWXd  S(   Nc         S  s   |  j  d d d d  S(   Nt   dotfilei    RÆ  (   R   (   R¥   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR     s    RÜ   t   772i   t   777s   ==s¿   (%(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stat
}()
}.mode
} & %(py13)s
{%(py13)s = %(py7)s(%(py9)s, %(py11)s)
}) == %(py22)s
{%(py22)s = %(py16)s(%(py18)s, %(py20)s)
}t   py22t   py20t   py18R|   R=   RA   RB   R   R¥   R   RC   R   R   RG   R
   s   assert %(py24)st   py24(   R  R­  R^   Rt   R|   R   R3   R   R   R   R   R   R   R   t   items(   R(   R   t	   recfiltert   oldmodesR¥   R   R   R   RS   RO   RP   RQ   t   @py_assert17t   @py_assert19t   @py_assert21R  t   @py_format23t   @py_format25R4  (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_chmod_rec_int
  s4    		 	 	    
      ÿ a   6t   strictRø   s   unicode issuec         C  s7  d } | j  d |  } | j   } | j   j } | d A} | j |  | j d  } | j | d t | j } | j }	 | |	  }
 |
 j } |   } | j } | | k } | rt	 j
 d f | f d f | | f  i	 d t j   k pý t	 j |  rt	 j |  n d d	 6t	 j |  d
 6t	 j |  d 6d t j   k pTt	 j |  rft	 j |  n d d 6t	 j |  d 6d t j   k pt	 j |  r­t	 j |  n d d 6t	 j |
  d 6t	 j |	  d 6t	 j |  d 6} d d i | d 6} t t	 j |    n  t } }	 }
 } } } } d  S(   Nu   something-Ã¢ÂÂ.txtRÿ   i   R  R^   s   ==sž   %(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py9)s
{%(py9)s = %(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py5)s
{%(py5)s = %(py3)s.basename
})
}.stat
}()
}.mode
} == %(py15)st   newmodeR@   RA   RB   RÂ   R   R   R   RC   RE   RG   R
   s   assert %(py17)sR?   (   Rs   RI   R­  R^   Rt   R   t   copyRD   R4   R   R3   R   R   R   R   R   R   R   (   R(   R   t
   unicode_fnRÂ   Rÿ   t   oldmodeR  R  R   R   RN   RS   RO   RP   RQ   Rn   RT   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_copy_archiving  s*    
	 	  	 	 	   ÿ 1   c         C  s£  | j  d  } | j d  } t j t  | j | d t | j   } | j   } | j } | j } | | k } | rat	 j
 d f | f d f | | f  i t	 j |  d 6d t j   k pÐ t	 j |  râ t	 j |  n d d 6t	 j |  d	 6d
 t j   k pt	 j |  r)t	 j |  n d
 d 6}	 d d i |	 d 6}
 t t	 j |
    n  t } } } | j } |   } | j } |   } | | } | t k  } | rít	 j
 d f | f d f | t f  i d t j   k põt	 j t  rt	 j t  n d d 6t	 j |  d 6d t j   k p<t	 j |  rNt	 j |  n d d 6t	 j |  d 6d t j   k pt	 j |  rt	 j |  n d d 6t	 j |  d 6t	 j |  d 6} d d i | d 6} t t	 j |    n  t } } } } } } | j } |   } | j } |   } | | } | t k  } | rt	 j
 d f | f d f | t f  i d t j   k pt	 j t  rt	 j t  n d d 6t	 j |  d 6d t j   k pÔt	 j |  ræt	 j |  n d d 6t	 j |  d 6d t j   k pt	 j |  r-t	 j |  n d d 6t	 j |  d 6t	 j |  d 6} d d i | d 6} t t	 j |    n  t } } } } } } d  S(   Nt   srct   dstR­  s   ==sF   %(py2)s
{%(py2)s = %(py0)s.mode
} == %(py6)s
{%(py6)s = %(py4)s.mode
}R   t   oldstatR   R   t   newstatR   R
   s   assert %(py8)sR   R·   s   (%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.atime
}()
} - %(py9)s
{%(py9)s = %(py7)s
{%(py7)s = %(py5)s.atime
}()
}) < %(py12)sRé  R<   RC   RE   RG   s   assert %(py14)sR;   s   (%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.mtime
}()
} - %(py9)s
{%(py9)s = %(py7)s
{%(py7)s = %(py5)s.mtime
}()
}) < %(py12)s(   Rs   R   RÐ   Rè  Ré  R  RD   R­  R^   R   R3   R   R   R   R   R   R   R   Rç  RÎ   (   R(   R   R  R  R  R  R   R   R   R   R5   RN   RS   RO   RJ   R®   RL   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_copy_stat_file$  sL    	 	   ¹   	 	 	 	 
   ÿ    	 	 	 	 
   ÿ    c         C  sm  d d d g } | j  d  } x* | D]" } | j  |  j | d t q% W| j  d  } t j t  | j | d t xì| D]ä} | j  |  j   } | j  |  j   } | j } | j }	 | |	 }
 |
 t k  } | sòt	 j
 d | f d |
 t f  i d
 t j   k s!t	 j |  r0t	 j |  n d
 d 6t	 j |  d 6d t j   k sht	 j |  rwt	 j |  n d d 6d t j   k st	 j t  r®t	 j t  n d d 6t	 j |	  d 6} d i | d 6} t t	 j |    n  d  } }	 }
 } | j } | j }	 | |	 }
 |
 t k  } | sEt	 j
 d | f d |
 t f  i d
 t j   k stt	 j |  rt	 j |  n d
 d 6t	 j |  d 6d t j   k s»t	 j |  rÊt	 j |  n d d 6d t j   k sòt	 j t  rt	 j t  n d d 6t	 j |	  d 6} d  i | d 6} t t	 j |    n  d  } }	 }
 } | j } | j } | | k } | sWt	 j
 d! | f d" | | f  i t	 j |  d 6d
 t j   k sÍt	 j |  rÜt	 j |  n d
 d 6t	 j |  d 6d t j   k st	 j |  r#t	 j |  n d d 6} d# i | d 6} t t	 j |    n  d  } } } q Wd  S($   NRÿ   R  t   cR  Rs   R  R­  R·   sS   (%(py2)s
{%(py2)s = %(py0)s.atime
} - %(py5)s
{%(py5)s = %(py3)s.atime
}) < %(py8)sR  R   R   R  R   Ré  R   RE   R
   s   assert %(py10)sR   sS   (%(py2)s
{%(py2)s = %(py0)s.mtime
} - %(py5)s
{%(py5)s = %(py3)s.mtime
}) < %(py8)ss   ==sF   %(py2)s
{%(py2)s = %(py0)s.mode
} == %(py6)s
{%(py6)s = %(py4)s.mode
}R   R   s   assert %(py8)s(   R·   (   sS   (%(py2)s
{%(py2)s = %(py0)s.atime
} - %(py5)s
{%(py5)s = %(py3)s.atime
}) < %(py8)ss   assert %(py10)s(   R·   (   sS   (%(py2)s
{%(py2)s = %(py0)s.mtime
} - %(py5)s
{%(py5)s = %(py3)s.mtime
}) < %(py8)ss   assert %(py10)s(   s   ==(   sF   %(py2)s
{%(py2)s = %(py0)s.mode
} == %(py6)s
{%(py6)s = %(py4)s.mode
}s   assert %(py8)s(   R   Rg   RD   RÐ   Rè  Ré  R  R­  Rç  R   R3   R   R   R   R   R   R   R   RÎ   R^   (   R(   R   t
   test_filesR  RÂ   R  R  R  R   R   RN   R   R5   R    R   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_copy_stat_dir0  sH     	 	 
   ê   	 	 
   ê   	 	   ³   c         C  s2   | j    j } | j    j } | j | |  d  S(   N(   R­  RØ  RÚ  t   chown(   R(   R   RØ  RÚ  (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_chown_identity@  s    c         C  sl   | j    j } | j    j } | j d  } | j d  z | j | | d d Wd  | j d d  Xd  S(   NR\   t   qlwkejqwlekRÜ   i   i    (   R­  RØ  RÚ  R   RÃ  R  Ru   (   R(   R   RØ  RÚ  R¥   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_chown_dangling_linkF  s    c         C  s2   | j    j } | j    j } | j | |  d  S(   N(   R­  RØ  RÚ  R  (   R(   R   RØ  RÚ  (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_chown_identity_rec_mayfailQ  s    (#   R,   R-   R#  R/  RÂ  RÅ  RÈ  RÊ  RÌ  RÎ  RÐ  RÑ  RÒ  RÔ  RÝ  Râ  Rã  Rë  Rî  Rð  Rò  Rô  R®  R  R   R$  R%  R   R
  R  R  t   failsonjythonR  R  R  (    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyRŒ  t  s6   																							$		t   TestUnicodePy2Py3c           B  s   e  Z e j j e j d
 k o* d e j k d d g Z	 e j j
 e j d k d d Z e d    Z e d    Z e j j
 d d  d	    Z RS(   i   i    t   LANGRø   s   cannot run test without locales3   unresolved encoding issues for pathnames on python3c         C  sv  t  j j | j  } d } | j |  } | j } | |  } | | k } | sdt j d | f d | | f  i d t j	   k s t j
 |  r¢ t j |  n d d 6t j |  d 6d t j	   k sÚ t j
 |  ré t j |  n d d 6d	 t j	   k st j
 |  r t j |  n d	 d
 6t j |  d 6}	 d i |	 d 6}
 t t j |
    n  d  } } } d  S(   Ns   hÃ€llos   ==sJ   %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py3)s)
} == %(py7)st   partR   R   R¥   R   R4  RC   RE   R
   s   assert %(py9)sRG   (   s   ==(   sJ   %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py3)s)
} == %(py7)ss   assert %(py9)s(   RF   R)   R   Rõ   Rs   R   R   R3   R   R   R   R   R   R   R   (   R(   R   R   R¥   R  R4  R   R   RN   Rv   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_join_ensuref  s    	    ê   c   	      C  sò   t  j j | j  } d } | j |  } | j |  d } | | k } | sä t j d | f d | | f  i d t j	   k s t j
 |  r  t j |  n d d 6t j |  d 6} d i | d
 6} t t j |    n  d  } } d  S(   Ns   hÃ€lloi    s   ==s   %(py1)s == %(py3)sR4  R   R   R
   s   assert %(py5)sRE   (   s   ==(   s   %(py1)s == %(py3)ss   assert %(py5)s(   RF   R)   R   Rõ   Rs   R;  R   R3   R   R   R   R   R   R   R   (	   R(   R   R¥   R  R4  R   R   R   R   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_listdirm  s       l   s/   changing read/write might break existing usagesc         C  s1  | j  d  } t j j d d  } | j |  | j } |   } | | k } | r<t j d f | f d f | | f  i t j |  d 6d t	 j
   k p« t j |  rœ t j |  n d d 6d	 t	 j
   k pâ t j |  rô t j |  n d	 d
 6t j |  d 6} d d i | d 6} t t j |    n  t } } } | j | j t j     | j } |   } | j }	 t j }
 |
   } |	 |  } | | k } | rt j d f | f d f | | f  i	 t j |  d 6t j |  d 6t j |
  d 6t j |  d 6d t	 j
   k p7t j |  rIt j |  n d d 6d	 t	 j
   k pnt j |  rt j |  n d	 d
 6t j |  d 6d t	 j
   k pµt j t  rÇt j t  n d d 6t j |	  d 6} d d i | d 6} t t j |    n  t } } } }	 }
 } } d  S(   NR\   s   hÃ€llot   utf8s   ==sC   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py6)sR   R¥   R   R  R   R   R
   s   assert %(py8)sR   sÂ   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py15)s
{%(py15)s = %(py8)s
{%(py8)s = %(py6)s.encode
}(%(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py9)s.getdefaultencoding
}()
})
}R@   RA   RB   Rú   RG   s   assert %(py17)sR?   (   R   RF   Rc   t   _totextRg   RÁ   R   R3   R   R   R   R   R   R   R   Rf   Rú   t   getdefaultencoding(   R(   R   R¥   R  R   R   R   R   R5   R   RO   RP   RQ   Rn   RT   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_read_writet  s2    	 	   ¹   	 	 	 	 	    ÿ 1   (   i   i    (   i   i    (   R,   R-   R   R$  t   skipifRú   t   version_infoR   t   environR/  R%  t	   bad_on_3xR  R  R!  (    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR  X  s   			t   TestBinaryAndTextMethodsc           B  s#   e  Z d    Z d   Z d   Z RS(   c         C  s.  | j  d  } t j j d d  } | j d  } | j |  | j } |   } | | k } | s@t j d | f d | | f  i t j	 |  d 6d t
 j   k s¶ t j |  rÅ t j	 |  n d d 6d	 t
 j   k sí t j |  rü t j	 |  n d	 d
 6t j	 |  d 6} d i | d 6}	 t t j |	    n  d  } } } | j d d  }
 |
 | k } | s.t j d | f d |
 | f  i d t
 j   k sŽt j |  rÃt j	 |  n d d 6d t
 j   k sët j |
  rút j	 |
  n d d 6} d i | d 6} t t j |    n  d  } t j } | j } | |
  } | sd d i t j	 |  d 6d t
 j   k st j t  r¢t j	 t  n d d 6t j	 |  d 6d t
 j   k sÚt j |
  rét j	 |
  n d d 6t j	 |  d 6} t t j |    n  d  } } } d  S(   NR\   s   hÃ€lloR  s   ==sJ   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read_binary
}()
} == %(py6)sR   R¥   R   t	   part_utf8R   R   R
   s   assert %(py8)sR   t   encodings   %(py0)s == %(py2)sR  Rè   s   assert %(py4)ssf   assert %(py7)s
{%(py7)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.builtin
}._istext
}(%(py5)s)
}RF   RC   RE   (   s   ==(   sJ   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read_binary
}()
} == %(py6)ss   assert %(py8)s(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   R   RF   Rc   R  Rf   t   write_binaryt   read_binaryR   R3   R   R   R   R   R   R   R   t	   read_textt   _istext(   R(   R   R¥   R  R'  R   R   R   R   R5   Rè   R6   R7   RN   Rv   (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_read_binwrite  s4    	 	   ³        	 	   ¬  c         C  s  | j  d  } t j j d d  } | j d  } | j | d d | j } |   } | | k } | sFt j d | f d | | f  i t j	 |  d 6d t
 j   k sŒ t j |  rË t j	 |  n d d	 6d
 t
 j   k só t j |  rt j	 |  n d
 d 6t j	 |  d 6} d i | d 6}	 t t j |	    n  d  } } } | j } d } | d |  } | | k }
 |
 spt j d |
 f d | | f  i t j	 |  d 6d t
 j   k sÖt j |  råt j	 |  n d d	 6d t
 j   k st j |  rt j	 |  n d d 6t j	 |  d 6t j	 |  d 6}	 d i |	 d 6} t t j |    n  d  } } } }
 d  S(   NR\   s   hÃ€lloR  R(  s   ==sJ   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read_binary
}()
} == %(py6)sR   R¥   R   R'  R   R   R
   s   assert %(py8)sR   sX   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.read_text
}(encoding=%(py4)s)
} == %(py8)sR  s   assert %(py10)sR   (   s   ==(   sJ   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read_binary
}()
} == %(py6)ss   assert %(py8)s(   s   ==(   sX   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.read_text
}(encoding=%(py4)s)
} == %(py8)ss   assert %(py10)s(   R   RF   Rc   R  Rf   t
   write_textR*  R   R3   R   R   R   R   R   R   R   R+  (   R(   R   R¥   R  R'  R   R   R   R   R5   R   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_read_textwrite  s*    	 	   ³   	     Ã   c         C  s³  | j  d  } t j j d d  } | j | d  | j d  } | | k } | rt j d f | f d f | | f  i d t j	   k p t j
 |  r­ t j |  n d d 6d t j	   k pÒ t j
 |  rä t j |  n d d 6} d	 d
 i | d 6} t t j |    n  t } t |  } t |  }	 | |	 k }
 |
 r¡t j d f |
 f d f | |	 f  i t j |  d 6d t j	   k p¢t j
 |  rŽt j |  n d d 6d t j	   k pÙt j
 t  rët j t  n d d 6d t j	   k pt j
 |  r"t j |  n d d 6d t j	   k pGt j
 t  rYt j t  n d d 6t j |	  d 6} d	 d i | d 6} t t j |    n  t } }
 }	 d  S(   NR\   R]   s   ==s   %(py0)s == %(py2)sR  R   Rè   R   R
   s   assert %(py4)sR   sN   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py8)s
{%(py8)s = %(py5)s(%(py6)s)
}R   R   R|  R   RE   R   s   assert %(py10)sR   (   R   RF   Rc   R  R.  R+  R   R3   R   R   R   R   R   R   R   R|  (   R(   R   R¥   R  Rè   R   R6   R7   R   R   R   R5   R    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   test_default_encoding  s&             ÿ (   (   R,   R-   R-  R/  R0  (    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyR&  ~  s   	
	(,   t
   __future__R    t   __builtin__R   t   _pytest.assertion.rewritet	   assertiont   rewriteR   RÐ   RF   R   R   Rú   t   py.pathR   R   Rj   R$  R%  R  R'  R"  R.  R#  Ré  R%   R/   t   CommonFSTestsR0   R(  R0  RX  R  R  R  R  R¡  RŠ  R§  R©  Rª  RŒ  R  R&  (    (    (    s=   /home/ronny/Projects/pytest-dev/py/testing/path/test_local.pyt   <module>   sD     			
	ÿ Qh								7ä&