
aDâWâ?  ã               @   s\   d  d l  Z d  d l j j Z d  d l Z d  d l Z Gd d „  d e ƒ Z	 d d „  Z
 d S)é    Nc               @   s”  e  Z d  Z d d „  Z d d „  Z d d „  Z d d „  Z d	 d
 „  Z d d „  Z d d „  Z	 d d „  Z
 d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d d  „  Z d! d" „  Z d# d$ „  Z d% d& „  Z d' d( „  Z d) d* „  Z d+ d, „  Z d- d. „  Z d/ d0 „  Z e j j j d1 ƒ d2 d3 „  ƒ Z d4 d5 „  Z  d6 d7 „  Z! d8 d9 „  Z" d: d; „  Z# d< d= „  Z$ d> d? „  Z% e j j j d1 ƒ d@ dA „  ƒ Z& dB dC „  Z' dD dE „  Z( dF dG „  Z) dH dI „  Z* dJ dK „  Z+ dL dM „  Z, dN dO „  Z- dP dQ „  Z. dR dS „  Z/ dT dU „  Z0 dV dW „  Z1 dX dY „  Z2 dZ d[ „  Z3 d\ d] „  Z4 d^ d_ „  Z5 d` da „  Z6 db dc „  Z7 dd de „  Z8 df dg „  Z9 dh di „  Z: dj dk „  Z; dl dm „  Z< dn do „  Z= dp dq „  Z> dr ds „  Z? dt du „  Z@ dv dw „  ZA dx dy „  ZB dz d{ „  ZC d| d} „  ZD d~ d „  ZE d€ d „  ZF d‚ dƒ „  ZG d„ d… „  ZH e j j jI d† ƒ d‡ dˆ „  ƒ ZJ e j j jI d† ƒ d‰ dŠ „  ƒ ZK d‹ S)ŒÚCommonFSTestsc             C   sá   | j  | ƒ } | | k } | s× t j d
 | f d | | f ƒ d d t j ƒ  k sc t j | ƒ rr t j | ƒ n d d d t j ƒ  k s™ t j | ƒ r¨ t j | ƒ n d i } d d	 | i } t t j | ƒ ƒ ‚ d  } d  S)Nú==ú%(py0)s == %(py2)sÚpy0ÚpÚpy2Úpath1Ú úassert %(py4)sÚpy4)r   )r   r
   )	Ú	__class__Ú
@pytest_arÚ_call_reprcompareÚ@py_builtinsÚlocalsÚ_should_repr_global_nameÚ	_safereprÚAssertionErrorÚ_format_explanation)Úselfr   r   Ú@py_assert1Ú@py_format3Ú@py_format5© r   ú9/home/ronny/Projects/pytest-dev/py/testing/path/common.pyÚtest_constructor_equality   s      ‘   z'CommonFSTests.test_constructor_equalityc             C   sð   | j  d ƒ } | j  d ƒ } | | k } | sæ t j d | f d | | f ƒ d d t j ƒ  k sr t j | ƒ r t j | ƒ n d d d t j ƒ  k s¨ t j | ƒ r· t j | ƒ n d i } d d
 | i } t t j | ƒ ƒ ‚ d  } d  S)NÚ	sampledirr   ú%(py0)s == %(py2)sr   Úp1r   Úp2r	   úassert %(py4)sr   )r   )r   r    )	Újoinr   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   Útest_eq_nonstring
   s      ‘   zCommonFSTests.test_eq_nonstringc          
   C   s
  | j  } | ƒ  } | | k } | sø t j d | f d | | f ƒ d t j | ƒ d t j | ƒ d d t j ƒ  k s„ t j | ƒ r“ t j | ƒ n d d d t j ƒ  k sº t j | ƒ rÉ t j | ƒ n d i } d d
 | i } t t j | ƒ ƒ ‚ d  } } } d  S)Nr   úB%(py0)s == %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s.new
}()
}r   Úpy6r   r   r   r	   úassert %(py8)sÚpy8)r   )r#   r%   )	Únewr   r   r   r   r   r   r   r   )r   r   Ú@py_assert3Ú@py_assert5r   Ú@py_format7Ú@py_format9r   r   r   Útest_new_identical   s    	 	   ¯   z CommonFSTests.test_new_identicalc       
      C   sû  | j  d ƒ } t | ƒ } | j } d } | | ƒ } | sÂ d d d t j | ƒ d t j | ƒ d d t j ƒ  k s… t j | ƒ r” t j | ƒ n d d t j | ƒ i } t t j	 | ƒ ƒ ‚ d  } } } | j
 } t | ƒ } | | ƒ } | séd d	 d
 t j | ƒ d d t j ƒ  k s1t j | ƒ r@t j | ƒ n d d d t j ƒ  k sgt j | ƒ rvt j | ƒ n d d t j | ƒ d d t j ƒ  k s¬t j t ƒ r»t j t ƒ n d d t j | ƒ i }	 t t j	 |	 ƒ ƒ ‚ d  } } } d  S)Nr   r	   zJassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.endswith
}(%(py4)s)
}r   r$   r   Ústrpr   zjassert %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py6)s
{%(py6)s = %(py3)s(%(py4)s)
})
}r&   r   Úpy3Ústr)r!   r/   Úendswithr   r   r   r   r   r   r   Ú
startswith)
r   r   r   r-   r   r(   r)   r*   Ú@py_assert7r+   r   r   r   Ú	test_join   s     	    q  	    Ý  zCommonFSTests.test_joinc       
      C   s  | j  | j d ƒ } t | ƒ } | j } d } | | ƒ } | sÉ d d d t j | ƒ d t j | ƒ d d t j ƒ  k sŒ t j | ƒ r› t j | ƒ n d d t j | ƒ i } t	 t j
 | ƒ ƒ ‚ d  } } } | j } t | ƒ } | | ƒ } | sðd d	 d
 t j | ƒ d d t j ƒ  k s8t j | ƒ rGt j | ƒ n d d d t j ƒ  k snt j | ƒ r}t j | ƒ n d d t j | ƒ d d t j ƒ  k s³t j t ƒ rÂt j t ƒ n d d t j | ƒ i }	 t	 t j
 |	 ƒ ƒ ‚ d  } } } | j  | j d d ƒ } t | ƒ } | j } d } | | ƒ } | sËd d d t j | ƒ d t j | ƒ d d t j ƒ  k sŽt j | ƒ rt j | ƒ n d d t j | ƒ i } t	 t j
 | ƒ ƒ ‚ d  } } } | j } t | ƒ } | | ƒ } | sòd d	 d
 t j | ƒ d d t j ƒ  k s:t j | ƒ rIt j | ƒ n d d d t j ƒ  k spt j | ƒ rt j | ƒ n d d t j | ƒ d d t j ƒ  k sµt j t ƒ rÄt j t ƒ n d d t j | ƒ i }	 t	 t j
 |	 ƒ ƒ ‚ d  } } } d  S)Nr   r	   zJassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.endswith
}(%(py4)s)
}r   r$   r   r-   r   zjassert %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py6)s
{%(py6)s = %(py3)s(%(py4)s)
})
}r&   r   r.   r/   é   )r!   Úsepr/   r0   r   r   r   r   r   r   r   r1   )
r   r   Únewpathr-   r   r(   r)   r*   r2   r+   r   r   r   Útest_join_normalized   s@    	    q  	    Ý  	    q  	    Ý  z"CommonFSTests.test_join_normalizedc             C   sÞ   | j  ƒ  } | | k } | sÔ t j d
 | f d | | f ƒ d d t j ƒ  k s` t j | ƒ ro t j | ƒ n d d d t j ƒ  k s– t j | ƒ r¥ t j | ƒ n d i } d d	 | i } t t j | ƒ ƒ ‚ d  } d  S)Nr   ú%(py0)s == %(py2)sr   r   r   r6   r	   úassert %(py4)sr   )r   )r8   r9   )	r!   r   r   r   r   r   r   r   r   )r   r   r6   r   r   r   r   r   r   Útest_join_noargs"   s      ‘   zCommonFSTests.test_join_noargsc             C   sŒ  | j  d ƒ } | d } | j } | ƒ  } | s¨ d d d t j | ƒ d d t j ƒ  k sk t j | ƒ rz t j | ƒ n d d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } | j	 } | ƒ  } | sAd d	 d t j | ƒ d d t j ƒ  k st j | ƒ rt j | ƒ n d d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } | j
 } | ƒ  } | sÚd d
 d t j | ƒ d d t j ƒ  k st j | ƒ r¬t j | ƒ n d d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } | j } | ƒ  } | } | szd d d t j | ƒ d d t j ƒ  k s=t j | ƒ rLt j | ƒ n d d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } d  S)NÚsampleÚdirr	   z@assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}r   r   r   r   zAassert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.exists
}()
}z@assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.isdir
}()
}zEassert not %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.isfile
}()
})r!   Úcheckr   r   r   r   r   r   r   ÚexistsÚisdirÚisfile)r   r   r   r   r(   r   r)   Ú@py_format6r   r   r   Útest_add_something&   s6    
	 	  b  
	 	  b  
	 	  b  
	 	   b  z CommonFSTests.test_add_somethingc       	      C   sÎ  | j  d d ƒ } | j ƒ  d d  … } | | j  d ƒ | g } | | k } | sá t j d | f d | | f ƒ d d t j ƒ  k s” t j | ƒ r£ t j | ƒ n d d t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } | j d d ƒ d  d … } | | j  d ƒ | g } | | k } | sÀt j d | f d | | f ƒ d d t j ƒ  k sst j | ƒ r‚t j | ƒ n d d t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } d  S)Nr   Ú	otherfileé   r   ú%(py0)s == %(py3)sr   Úparr.   r	   úassert %(py5)sÚpy5ÚreverseTÚrevparéýÿÿÿ)r   )rE   rG   )r   )rE   rG   )
r!   Úpartsr   r   r   r   r   r   r   r   )	r   r   r6   rF   Ú@py_assert2r   Ú@py_format4rA   rJ   r   r   r   Ú
test_parts.   s"       j   
   j   zCommonFSTests.test_partsc             C   sð   | j  d ƒ } | j | ƒ } | | k } | sæ t j d | f d | | f ƒ d d t j ƒ  k sr t j | ƒ r t j | ƒ n d d d t j ƒ  k s¨ t j | ƒ r· t j | ƒ n d i } d d
 | i } t t j	 | ƒ ƒ ‚ d  } d  S)Nr   r   ú%(py0)s == %(py2)sr   Úxr   r   r	   úassert %(py4)sr   )r   )rP   rR   )
r!   Úcommonr   r   r   r   r   r   r   r   )r   r   ÚotherrQ   r   r   r   r   r   r   Útest_common6   s      ‘   zCommonFSTests.test_commonc             C   sñ  | d d } t  | j ƒ  ƒ } | j ƒ  d } | | } | | k } | st j d | f d | | f ƒ d d t j ƒ  k sŽ t j | ƒ r t j | ƒ n d d t j | ƒ d d	 t j ƒ  k sÓ t j | ƒ râ t j | ƒ n d	 i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } } | | k } | sçt j d | f d | | f ƒ d d t j ƒ  k sst j | ƒ r‚t j | ƒ n d d d	 t j ƒ  k s©t j | ƒ r¸t j | ƒ n d	 i }	 d d |	 i }
 t	 t j
 |
 ƒ ƒ ‚ d  } d  S)NZ
dirnoexistznonexisting fileÚinú(%(py0)s / %(py2)s) in %(py5)sr   r   r   rH   rF   r	   úassert %(py7)sÚpy7ú%(py0)s in %(py2)súassert %(py4)sr   )rV   )rW   rX   )rV   )rZ   r[   )ÚlistrL   Úpopr   r   r   r   r   r   r   r   )r   r   r6   rF   r   r(   Ú@py_assert4rA   Ú@py_format8r   r   r   r   r   Útest_parents_nonexisting_file;   s"    
 
         ‘   z+CommonFSTests.test_parents_nonexisting_filec       
   
   C   sP  | j  d ƒ } | j } d } | d | ƒ } | s¹ d d d t j | ƒ d t j | ƒ d d t j ƒ  k s| t j | ƒ r‹ t j | ƒ n d d	 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } | j } d
 } | d | ƒ } | sqd d d t j | ƒ d t j | ƒ d d t j ƒ  k s4t j | ƒ rCt j | ƒ n d d	 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } | j	 } d } | | k } | s>t j
 d | f d | | f ƒ d d t j ƒ  k sât j | ƒ rñt j | ƒ n d d	 t j | ƒ d t j | ƒ i } d d | i }	 t t j |	 ƒ ƒ ‚ d  } } } d  S)Nr   Úbasenamer	   zPassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(basename=%(py4)s)
}r   r$   r   r6   r   ÚxyzZnotbasenamezSassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(notbasename=%(py4)s)
}r   ú0%(py2)s
{%(py2)s = %(py0)s.basename
} == %(py5)srH   úassert %(py7)srY   )r   )rc   rd   )r!   r=   r   r   r   r   r   r   r   ra   r   )
r   r   r6   r   r(   r)   r*   r^   rA   r_   r   r   r   Útest_basename_checksB   s.    	    q  	    q  	    y   z"CommonFSTests.test_basename_checksc          
   C   sQ  | j  d ƒ } | j } d } | d | ƒ } | s¹ d d d t j | ƒ d t j | ƒ d d t j ƒ  k s| t j | ƒ r‹ t j | ƒ n d d	 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } | j	 } | sGt j
 d ƒ d
 d d t j ƒ  k s
t j | ƒ rt j | ƒ n d d	 t j | ƒ i } t t j | ƒ ƒ ‚ d  } d  S)Nr   ra   r	   zPassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(basename=%(py4)s)
}r   r$   r   r6   r   z.
>assert %(py2)s
{%(py2)s = %(py0)s.basename
})r!   r=   r   r   r   r   r   r   r   ra   Ú_format_assertmsg)r   r   r6   r   r(   r)   r*   r   r   r   r   Útest_basenameH   s    	    q  	  \  zCommonFSTests.test_basenamec             C   sR  | j  d ƒ } | j } t | ƒ } | | k } | s@t j d | f d | | f ƒ d d t j ƒ  k sx t j t ƒ r‡ t j t ƒ n d d t j | ƒ d d t j ƒ  k s½ t j | ƒ rÌ t j | ƒ n d d	 t j | ƒ d
 d t j ƒ  k st j | ƒ rt j | ƒ n d i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } } d  S)Nr   r   úM%(py2)s
{%(py2)s = %(py0)s.dirname
} == %(py7)s
{%(py7)s = %(py4)s(%(py5)s)
}r   r/   rY   r   r6   r   rH   r   r	   úassert %(py9)sÚpy9)r   )rh   ri   )r!   Údirnamer/   r   r   r   r   r   r   r   r   )r   r   r6   r   Ú@py_assert6r(   r_   Ú@py_format10r   r   r   Útest_dirnameM   s    	    å   zCommonFSTests.test_dirnamec          
   C   s  | j  d ƒ } | j } | ƒ  } | | k } | st j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k s„ t j | ƒ r“ t j | ƒ n d d d t j ƒ  k sº t j | ƒ rÉ t j | ƒ n d d	 t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } } d  S)Nr   r   úF%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.dirpath
}()
} == %(py6)sr   r$   r   r   r6   r   r	   úassert %(py8)sr&   )r   )ro   rp   )
r!   Údirpathr   r   r   r   r   r   r   r   )r   r   r6   r   r(   r)   r*   r+   r   r   r   Útest_dirpathQ   s    	 	   ¯   zCommonFSTests.test_dirpathc             C   s‰  | j  d ƒ } | j } d } | | ƒ } | j  } d } | | ƒ } | | k }	 |	 sgt j d |	 f d | | f ƒ d t j | ƒ d d t j ƒ  k s¨ t j | ƒ r· t j | ƒ n d d d	 t j ƒ  k sÞ t j | ƒ rí t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i }
 d d |
 i } t t j	 | ƒ ƒ ‚ d  } } } }	 } } } d  S)Nr   rQ   r   úŠ%(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)
}Úpy12r&   r   r   r6   r   Úpy14r$   Úpy10r   r	   úassert %(py16)sÚpy16)r   )rs   rw   )
r!   rq   r   r   r   r   r   r   r   r   )r   r   r6   r   r(   r)   Ú@py_assert9Ú@py_assert11Ú@py_assert13r2   Ú@py_format15Ú@py_format17r   r   r   Útest_dirpath_with_argsU   s    	   	     ë   z$CommonFSTests.test_dirpath_with_argsc             C   s0  | j  d ƒ } | j d d ƒ } | j } d } | | k } | sà t j d | f d | | f ƒ d d t j ƒ  k s„ t j | ƒ r“ t j | ƒ n d d t j | ƒ d	 t j | ƒ i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } } | j } | ƒ  } | j }	 |	 ƒ  }
 | |
 k } | st j d | f d | |
 f ƒ d t j |	 ƒ d d t j ƒ  k sut j | ƒ r„t j | ƒ n d d t j | ƒ d d t j ƒ  k sºt j | ƒ rÉt j | ƒ n d d t j |
 ƒ d t j | ƒ i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } } }	 }
 d  S)NÚ
samplefilera   Úsamplefile2r   ú0%(py2)s
{%(py2)s = %(py0)s.basename
} == %(py5)sr   Únewbaser   rH   r	   úassert %(py7)srY   ú|%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.dirpath
}()
} == %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s.dirpath
}()
}r&   r   r$   r6   rv   úassert %(py12)srt   )r   )r   rƒ   )r   )r„   r…   )r!   r'   ra   r   r   r   r   r   r   r   r   rq   )r   r   r6   r‚   r   r^   r(   rA   r_   r2   ry   r)   Ú@py_format11Ú@py_format13r   r   r   Útest_newbasenameY   s(    	    y   	 	 	 	   Í   zCommonFSTests.test_newbasenamec       
      C   s  | j  } d } | | ƒ } | j } | ƒ  } | } | sÞ d d d t j | ƒ d d t j ƒ  k st t j | ƒ rƒ t j | ƒ n d d t j | ƒ d t j | ƒ d	 t j | ƒ d
 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } } | j  } d } | | ƒ } | j } d } | d | ƒ } | sêd d d t j | ƒ d t j | ƒ d d t j ƒ  k s€t j | ƒ rt j | ƒ n d d t j | ƒ d t j | ƒ d	 t j | ƒ d
 t j | ƒ i }	 t t j |	 ƒ ƒ ‚ d  } } } } } } d  S)NZdoes_not_existr	   z~assert not %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}()
}r&   r   r   r   r$   rv   r   r   r>   z‰assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(exists=%(py10)s)
}rt   )	r!   r=   r   r   r   r   r   r   r   )
r   r   r   r(   r)   r2   ry   rz   Ú@py_format12r‡   r   r   r   Útest_not_exists_   s(    	   	 	     	   	    ž  zCommonFSTests.test_not_existsc             C   sÏ  | j  } d } | | ƒ } | j } | ƒ  } | s× d d d t j | ƒ d d t j ƒ  k sm t j | ƒ r| t j | ƒ n d d t j | ƒ d t j | ƒ d	 t j | ƒ d
 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } | j  } d } | | ƒ } | j } d } | d | ƒ } | sßd d d t j | ƒ d t j | ƒ d d t j ƒ  k sut j | ƒ r„t j | ƒ n d d t j | ƒ d t j | ƒ d	 t j | ƒ d
 t j | ƒ i }	 t t j |	 ƒ ƒ ‚ d  } } } } } } | j  } d } | | ƒ } | j	 } | ƒ  } | sÐd d d t j | ƒ d d t j ƒ  k sft j | ƒ rut j | ƒ n d d t j | ƒ d t j | ƒ d	 t j | ƒ d
 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } | j  } d } | | ƒ } | j
 } | ƒ  } | s½d d d t j | ƒ d d t j ƒ  k sSt j | ƒ rbt j | ƒ n d d t j | ƒ d t j | ƒ d	 t j | ƒ d
 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } | j  } d } | | ƒ } | j } | ƒ  } | } | s±d d d t j | ƒ d d t j ƒ  k sGt j | ƒ rVt j | ƒ n d d t j | ƒ d t j | ƒ d	 t j | ƒ d
 t j | ƒ i }
 t t j |
 ƒ ƒ ‚ d  } } } } } } d  S)Nr   r	   zzassert %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}()
}r&   r   r   r   r$   rv   r   é   r>   z‰assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(exists=%(py10)s)
}rt   z{assert %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.exists
}()
}z{assert %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.isfile
}()
}z~assert not %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.isdir
}()
})r!   r=   r   r   r   r   r   r   r   r>   r@   r?   )r   r   r   r(   r)   r2   ry   r†   rz   r‡   r‰   r   r   r   Útest_existsc   s^    	   	 	    	   	    ž  	   	 	    	   	 	    	   	 	     zCommonFSTests.test_existsc             C   s  t  t | j d ƒ ƒ ƒ | j } d } | | ƒ } | j } d } | d | ƒ } | sd d d t j | ƒ d t j | ƒ d d	 t j ƒ  k s¡ t j | ƒ r° t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t	 t j
 | ƒ ƒ ‚ d  } } } } } } | j } d } | | ƒ } | j } d } | d | ƒ } | sd d d t j | ƒ d t j | ƒ d d	 t j ƒ  k s­t j | ƒ r¼t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t	 t j
 | ƒ ƒ ‚ d  } } } } } } | j } d } | | ƒ } | j } d } | d | ƒ } | }	 |	 s*d d d t j | ƒ d t j | ƒ d d	 t j ƒ  k sÀt j | ƒ rÏt j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i }
 t	 t j
 |
 ƒ ƒ ‚ d  } } } } } } }	 | j } d } | | ƒ } | j } | ƒ  } | sd d d t j | ƒ d d	 t j ƒ  k sµt j | ƒ rÄt j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t	 t j
 | ƒ ƒ ‚ d  } } } } } | j } d } | | ƒ } | j } | ƒ  } | } | sd d d t j | ƒ d d	 t j ƒ  k s©t j | ƒ r¸t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t	 t j
 | ƒ ƒ ‚ d  } } } } } } | j } d } | | ƒ } | j } | ƒ  } | sd d d t j | ƒ d d	 t j ƒ  k sšt j | ƒ r©t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t	 t j
 | ƒ ƒ ‚ d  } } } } } d  S)Nr   r‹   r<   r	   z†assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(dir=%(py10)s)
}rt   r&   r   r   r   r$   rv   r   r   Únotdirz‰assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(notdir=%(py10)s)
}zŠassert not %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(dir=%(py10)s)
}z{assert %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.exists
}()
}z~assert not %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.isdir
}()
}z{assert %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.isfile
}()
})ÚprintÚreprr!   r=   r   r   r   r   r   r   r   r>   r?   r@   )r   r   r   r(   r)   r2   ry   rz   r‡   r{   Ú@py_format14r†   r‰   r   r   r   Útest_dirj   sx    	   	    ž  	   	    ž  	   	     ž  	   	 	    	   	 	     	   	 	    zCommonFSTests.test_dirc             C   sD  | j  } d } | | ƒ } | j } d } | d | ƒ } | sò d d d t j | ƒ d t j | ƒ d d	 t j ƒ  k sˆ t j | ƒ r— t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } } | j  } d } | | ƒ } | j	 } d } | | ƒ } | sûd d d t j | ƒ d t j | ƒ d d	 t j ƒ  k s‘t j | ƒ r t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } } | j  } d } | | ƒ } | j	 } d } | | ƒ } | }	 |	 sd d d t j | ƒ d t j | ƒ d d	 t j ƒ  k s¡t j | ƒ r°t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i }
 t t j |
 ƒ ƒ ‚ d  } } } } } } }	 | j  } d } | | ƒ } | j } d } | d | ƒ } | }	 |	 s"d d d t j | ƒ d t j | ƒ d d	 t j ƒ  k s¸t j | ƒ rÇt j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i }
 t t j |
 ƒ ƒ ‚ d  } } } } } } }	 d  S)Nr   zs*eÚfnmatchr	   zŠassert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(fnmatch=%(py10)s)
}rt   r&   r   r   r   r$   rv   r   z„assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.fnmatch
}(%(py10)s)
}zs*xzˆassert not %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.fnmatch
}(%(py10)s)
}zŽassert not %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(fnmatch=%(py10)s)
})
r!   r=   r   r   r   r   r   r   r   r’   )r   r   r   r(   r)   r2   ry   rz   r‡   r{   r   r   r   r   Útest_fnmatch_files   sT    	   	    ž  	   	    ž  	   	     ž  	   	     ž  zCommonFSTests.test_fnmatch_filec          
   C   sý   | j  j d g ƒ } | j d ƒ } | j } | d | ƒ } | sï d d d t j | ƒ d d t j ƒ  k s| t j | ƒ r‹ t j | ƒ n d d	 t j | ƒ d
 d t j ƒ  k sÁ t j | ƒ rÐ t j | ƒ n d i } t t j	 | ƒ ƒ ‚ d  } } d  S)Nzs*filer   r’   r	   zOassert %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.check
}(fnmatch=%(py3)s)
}rH   r   Úsfiler   r.   Úpattern)
r5   r!   r=   r   r   r   r   r   r   r   )r   r   r•   r”   r   r^   rA   r   r   r   Útest_fnmatch_diry   s    	   ˜  zCommonFSTests.test_fnmatch_dirc             C   sc  | j  d d ƒ } | j } | | ƒ } | j } | j  } d d g } | | ƒ } | | k }	 |	 r´t j d f |	 f d f | | f ƒ d t j | ƒ d t j | ƒ d d t j ƒ  k pÇ t j | ƒ rÙ t j | ƒ n d d	 d
 t j ƒ  k pý t j | ƒ rt j | ƒ n d
 d t j | ƒ d d t j ƒ  k pBt j | ƒ rTt j | ƒ n d d t j | ƒ d t j | ƒ d t j | ƒ i	 }
 d d d |
 i } t	 t j
 | ƒ ƒ ‚ d  } } }	 } } } } | j } | d | ƒ } | ržd d d t j | ƒ d d t j ƒ  k p(t j | ƒ r:t j | ƒ n d d t j | ƒ d	 d
 t j ƒ  k pmt j | ƒ rt j | ƒ n d
 i } t	 t j
 | ƒ ƒ ‚ d  } } | j } | d | ƒ } | rtd d d t j | ƒ d d
 t j ƒ  k pþt j | ƒ rt j | ƒ n d
 d t j | ƒ d	 d t j ƒ  k pCt j | ƒ rUt j | ƒ n d i } t	 t j
 | ƒ ƒ ‚ d  } } | j } | d | ƒ } | }	 |	 rQd d d t j | ƒ d d
 t j ƒ  k pÛt j | ƒ rít j | ƒ n d
 d t j | ƒ d	 d t j ƒ  k p t j | ƒ r2t j | ƒ n d i } t	 t j
 | ƒ ƒ ‚ d  } } }	 d  S)Nr   rC   r   z¡%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.relto
}(%(py3)s)
} == %(py15)s
{%(py15)s = %(py11)s
{%(py11)s = %(py9)s
{%(py9)s = %(py7)s.sep
}.join
}(%(py13)s)
}rj   Úpy13r   Úlr.   r   Úpy11rY   Úpy15r   rH   r	   zassert %(py17)sÚpy17ÚreltozMassert %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.check
}(relto=%(py3)s)
}ZnotreltozPassert %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.check
}(notrelto=%(py3)s)
}zQassert not %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.check
}(relto=%(py3)s)
})r!   rœ   r5   r   r   r   r   r   r   r   r   r=   )r   r   r˜   r   r^   Ú@py_assert8Ú@py_assert10Ú@py_assert12Ú@py_assert14rl   Ú@py_format16Ú@py_format18rA   r*   r   r   r   Ú
test_relto~   sB    	  	 	     ÿ (   	   ˜  
	   ˜  
	    ˜  zCommonFSTests.test_reltoc             C   s£  | } | j  } | j | ƒ } d } | | k } | sÅ t j d | f d  | | f ƒ d d t j ƒ  k sx t j | ƒ r‡ t j | ƒ n d d t j | ƒ i } d! d	 | i } t t j	 | ƒ ƒ ‚ d  } } | j | j
 d
 d ƒ ƒ } d
 } | | }	 d }
 |	 |
 } | | k } | sðt j d" | f d# | | f ƒ d d t j ƒ  k s^t j | ƒ rmt j | ƒ n d d t j |
 ƒ d d t j ƒ  k s£t j | ƒ r²t j | ƒ n d d t j | ƒ i } d$ d | i } t t j	 | ƒ ƒ ‚ d  } } }	 }
 } | j | j ƒ  j
 d ƒ ƒ } d } | | }	 d }
 |	 |
 } | | k } | s*t j d% | f d& | | f ƒ d d t j ƒ  k s˜t j | ƒ r§t j | ƒ n d d t j |
 ƒ d d t j ƒ  k sÝt j | ƒ rìt j | ƒ n d d t j | ƒ i } d' d | i } t t j	 | ƒ ƒ ‚ d  } } }	 }
 } | j } | j } | ƒ  }
 | |
 ƒ } d } | | k } | s€t j d( | f d) | | f ƒ d t j | ƒ d t j | ƒ d d t j ƒ  k sßt j | ƒ rît j | ƒ n d d d t j ƒ  k st j | ƒ r$t j | ƒ n d d t j |
 ƒ d t j | ƒ d	 t j | ƒ i } d* d | i } t t j	 | ƒ ƒ ‚ d  } } }
 } } } | j } d
 } | | ƒ }	 d
 } |	 | k } | s‰t j d+ | f d, |	 | f ƒ d t j | ƒ d t j | ƒ d t j |	 ƒ d d t j ƒ  k s<t j | ƒ rKt j | ƒ n d d t j | ƒ i } d- d | i } t t j	 | ƒ ƒ ‚ d  } } }	 } } d  S).NÚ.r   ú%(py0)s == %(py3)sr   Úsr.   r	   úassert %(py5)srH   ÚhelloÚworldú*%(py0)s == ((%(py3)s + %(py4)s) + %(py7)s)r   r5   rY   úassert %(py10)srv   Zsisterz..ú†%(py9)s
{%(py9)s = %(py2)s
{%(py2)s = %(py0)s.bestrelpath
}(%(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.dirpath
}()
})
} == %(py12)srj   rt   Úcurdirr   úassert %(py14)sru   úQ%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.bestrelpath
}(%(py4)s)
} == %(py9)sr$   úassert %(py11)sr™   )r   )r¥   r§   )r   )rª   r«   )r   )rª   r«   )r   )r¬   r®   )r   )r¯   r°   )r5   Úbestrelpathr   r   r   r   r   r   r   r   r!   rq   )r   r   r­   r5   r¦   rM   r   rN   rA   r)   rl   r   r+   r†   r^   rz   rž   r‡   r|   r(   r2   rm   r‰   r   r   r   Útest_bestrelpath…   sj    	   j   
 
  
   ¯    
  
   ¯   	 	 	     Ü   	      —   zCommonFSTests.test_bestrelpathc          
   C   sÜ  | j  d ƒ } | j  d ƒ } | j } | | ƒ } | } | sí d d d t j | ƒ d d t j ƒ  k sz t j | ƒ r‰ t j | ƒ n d d t j | ƒ d	 d
 t j ƒ  k s¿ t j | ƒ rÎ t j | ƒ n d
 i } t t j | ƒ ƒ ‚ d  } } } | j } | | ƒ } | } | sÊd d d t j | ƒ d d
 t j ƒ  k sWt j | ƒ rft j | ƒ n d
 d t j | ƒ d	 d t j ƒ  k sœt j | ƒ r«t j | ƒ n d i } t t j | ƒ ƒ ‚ d  } } } d  S)NZbcdeÚbr	   zKassert not %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.relto
}(%(py3)s)
}rH   r   Úl1r   r.   Úl2)	r!   rœ   r   r   r   r   r   r   r   )r   r   r´   rµ   r   r^   rl   r*   r   r   r   Útest_relto_not_relative“   s     	    ˜  	    ˜  z%CommonFSTests.test_relto_not_relativezsys.platform.startswith('java')c       	      C   sm  | j  ƒ  } | j } d } | | ƒ } | | k } | st j d | f d | | f ƒ d t j | ƒ d t j | ƒ d d t j ƒ  k s™ t j | ƒ r¨ t j | ƒ n d d d	 t j ƒ  k sÏ t j | ƒ rÞ t j | ƒ n d	 d
 t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } } } | j } d } | | ƒ } | | k } | s>t j d | f d | | f ƒ d t j | ƒ d t j | ƒ d d t j ƒ  k s»t j | ƒ rÊt j | ƒ n d d d	 t j ƒ  k sñt j | ƒ r t j | ƒ n d	 d
 t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } } } t
 j j t
 j j d ƒ d  S)Nr   rV   úJ%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
} in %(py8)sr   r$   r   r   r&   r˜   r   r	   úassert %(py10)srv   r   z"path1.join('samplefile').listdir())rV   )r·   r¸   )rV   )r·   r¸   )Úlistdirr!   r   r   r   r   r   r   r   r   ÚpyÚtestÚraisesÚerrorÚENOTDIR)	r   r   r˜   r   r(   r)   r2   r+   r†   r   r   r   Útest_listdir™   s*    	     ¾   	     ¾   zCommonFSTests.test_listdirc             C   s#  | j  d ƒ } t | ƒ } | s¿ d d d d t j ƒ  k sL t j | ƒ r[ t j | ƒ n d d d t j ƒ  k s‚ t j t ƒ r‘ t j t ƒ n d d t j | ƒ i } t t j | ƒ ƒ ‚ d  } | d	 } | st j	 | j
 d
 ƒ ƒ d d t j | ƒ i } t t j | ƒ ƒ ‚ d  } d  S)Nzs*dirr	   z,assert %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}Úpy1r˜   r   Úlenr.   r   r   z
>assert %(py1)s)r¹   rÁ   r   r   r   r   r   r   r   rf   r!   )r   r   r˜   rM   rN   Ú@py_assert0Ú@py_format2r   r   r   Útest_listdir_fnmatchstring¡   s      ‰  
  /  z(CommonFSTests.test_listdir_fnmatchstringc             C   sh  | j  d d „  ƒ } | j } d } | | ƒ } | | k } | s%t j d | f d | | f ƒ d t j | ƒ d t j | ƒ d d	 t j ƒ  k s¢ t j | ƒ r± t j | ƒ n d	 d
 d t j ƒ  k sØ t j | ƒ rç t j | ƒ n d d t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } } } | j } d } | | ƒ } | | k } | }	 |	 sNt j d | f d | | f ƒ d t j | ƒ d t j | ƒ d d	 t j ƒ  k sËt j | ƒ rÚt j | ƒ n d	 d
 d t j ƒ  k st j | ƒ rt j | ƒ n d d t j | ƒ i } d d | i }
 t t j	 |
 ƒ ƒ ‚ d  } } } } }	 d  S)Nc             S   s   |  j  d d ƒ S)Nr<   r‹   )r=   )rQ   r   r   r   Ú<lambda>§   s    z3CommonFSTests.test_listdir_filter.<locals>.<lambda>r   rV   úJ%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
} in %(py8)sr   r$   r   r   r&   r˜   r   r	   úassert %(py10)srv   r   úassert not %(py10)s)rV   )rÆ   rÇ   )rV   )rÆ   rÈ   )
r¹   r!   r   r   r   r   r   r   r   r   )r   r   r˜   r   r(   r)   r2   r+   r†   rz   r‰   r   r   r   Útest_listdir_filter¦   s(    	     ¾   	      ¾   z!CommonFSTests.test_listdir_filterc       
      C   s:  | j  d d „  d d ƒ} | j } d } | | ƒ } | d } | | k } | st j d | f d | | f ƒ d	 t j | ƒ d
 t j | ƒ d t j | ƒ d d t j ƒ  k sÁ t j | ƒ rÐ t j | ƒ n d d t j | ƒ i } d d | i }	 t t j	 |	 ƒ ƒ ‚ d  } } } } } | j } d } | | ƒ } | d } | | k } | st j d | f d | | f ƒ d	 t j | ƒ d
 t j | ƒ d t j | ƒ d d t j ƒ  k sÊt j | ƒ rÙt j | ƒ n d d t j | ƒ i } d d | i }	 t t j	 |	 ƒ ƒ ‚ d  } } } } } | j } d } | | ƒ } | d } | | k } | s t j d | f d | | f ƒ d	 t j | ƒ d
 t j | ƒ d t j | ƒ d d t j ƒ  k sÓt j | ƒ rât j | ƒ n d d t j | ƒ i } d d | i }	 t t j	 |	 ƒ ƒ ‚ d  } } } } } d  S)Nc             S   s   |  j  d d ƒ S)NÚ
basestartsr;   )r=   )rQ   r   r   r   rÅ   ¬   s    z3CommonFSTests.test_listdir_sorted.<locals>.<lambda>ÚsortTr   r   r   úJ%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
} == %(py9)sr   rj   r$   r   r   r   r	   úassert %(py11)sr™   r   r‹   Úsamplepickler4   )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   r2   rm   r‰   r   r   r   Útest_listdir_sorted«   s>    	   
   —   	   
   —   	   
   —   z!CommonFSTests.test_listdir_sortedc             C   s,  g  } x* | j  ƒ  D] } | j | j | ƒ ƒ q Wd } | | k } | sÚ t j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k sœ t j | ƒ r« t j | ƒ n d i } d d	 | i } t	 t j
 | ƒ ƒ ‚ d  } } | j } | j }	 d d
 g }
 |	 |
 ƒ } | | k } | st j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k sqt j | ƒ r€t j | ƒ n d d t j |	 ƒ d t j |
 ƒ d d t j ƒ  k sÅt j | ƒ rÔt j | ƒ n d d t j | ƒ i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } }	 }
 } } d  S)Nr   rV   ú%(py1)s in %(py3)srÀ   r.   r˜   r	   úassert %(py5)srH   rC   úd%(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.sep
}.join
}(%(py6)s)
} in %(py10)sr&   r   r   r   r$   rv   r   úassert %(py12)srt   )rV   )rÐ   rÑ   )rV   )rÒ   rÓ   )ÚvisitÚappendrœ   r   r   r   r   r   r   r   r   r5   r!   )r   r   r˜   ÚirÂ   rM   rN   rA   r   r(   r)   r2   ry   r†   r‡   r   r   r   Útest_visit_nofilter±   s(       j   
	 	     Í   z!CommonFSTests.test_visit_nofilterc             C   sC  g  } x6 | j  d  d d „  ƒ D] } | j | j | ƒ ƒ q Wd } | | k } | sæ t j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k s¨ t j | ƒ r· t j | ƒ n d i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } | j } | j }	 d d g }
 |	 |
 ƒ } | | k } | } | s%t j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k s„t j | ƒ r“t j | ƒ n d d t j |	 ƒ d t j |
 ƒ d d t j ƒ  k sØt j | ƒ rçt j | ƒ n d d t j | ƒ i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } }	 }
 } } } d  S)Nc             S   s   |  j  d k S)Nr   )ra   )rQ   r   r   r   rÅ   º   s    z4CommonFSTests.test_visit_norecurse.<locals>.<lambda>r   rV   ú%(py1)s in %(py3)srÀ   r.   r˜   r	   úassert %(py5)srH   rC   úd%(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.sep
}.join
}(%(py6)s)
} in %(py10)sr&   r   r   r   r$   rv   r   úassert not %(py12)srt   )rV   )rØ   rÙ   )rV   )rÚ   rÛ   )rÔ   rÕ   rœ   r   r   r   r   r   r   r   r   r5   r!   )r   r   r˜   rÖ   rÂ   rM   rN   rA   r   r(   r)   r2   ry   r{   r†   r   r   r   r   Útest_visit_norecurse¸   s*       j   
	 	      Í   z"CommonFSTests.test_visit_norecursec             C   s[  g  } x- | j  d ƒ D] } | j | j | ƒ ƒ q Wt | ƒ } | sï t j d ƒ d d d t j ƒ  k s| t j | ƒ r‹ t j	 | ƒ n d d d t j ƒ  k s² t j t ƒ rÁ t j	 t ƒ n d d t j	 | ƒ i } t
 t j | ƒ ƒ ‚ d  } d	 } | | k } | sœt j d | f d | | f ƒ d t j	 | ƒ d d t j ƒ  k s^t j | ƒ rmt j	 | ƒ n d i } d d | i } t
 t j | ƒ ƒ ‚ d  } } d } | | k } | sMt j d | f d | | f ƒ d t j	 | ƒ d d t j ƒ  k st j | ƒ rt j	 | ƒ n d i } d d | i } t
 t j | ƒ ƒ ‚ d  } } d  S)Nz*dirr4   z.
>assert %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}rÀ   r˜   r   rÁ   r.   r   rV   ú%(py1)s in %(py3)sr	   úassert %(py5)srH   Úotherdir)rV   )rÝ   rÞ   )rV   )rÝ   rÞ   )rÔ   rÕ   rœ   rÁ   r   rf   r   r   r   r   r   r   r   )r   r   r˜   rÖ   rM   rN   rÂ   rA   r   r   r   Útest_visit_filterfunc_is_string¿   s,      ’     j   
   j   z-CommonFSTests.test_visit_filterfunc_is_stringc             C   sÐ  | j  d ƒ } | j } t j } | j } | d | ƒ } t | ƒ } g  } | | k }	 |	 r®t j d f |	 f d f | | f ƒ d t j | ƒ d t j | ƒ d t j | ƒ d d	 t	 j
 ƒ  k pÐ t j t ƒ râ t j t ƒ n d	 d
 d t	 j
 ƒ  k pt j t ƒ rt j t ƒ n d d d t	 j
 ƒ  k p<t j | ƒ rNt j | ƒ n d d t j | ƒ d t j | ƒ d t j | ƒ i	 }
 d d d |
 i } t t j | ƒ ƒ ‚ d  } } } } } }	 } d  S)NZnonexistingÚignorer   z¬%(py12)s
{%(py12)s = %(py0)s(%(py10)s
{%(py10)s = %(py3)s
{%(py3)s = %(py1)s.visit
}(ignore=%(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s.error
}.ENOENT
})
})
} == %(py15)srv   rt   r&   r   r\   r   rº   rÀ   r   r$   r.   rš   r	   zassert %(py17)sr›   )r!   rÔ   rº   r½   ÚENOENTr\   r   r   r   r   r   r   r   r   )r   r   r   rM   r)   r2   ry   rz   r    r{   r¡   r¢   r   r   r   Útest_visit_ignoreÇ   s    	 	 	      ÿ (   zCommonFSTests.test_visit_ignorec             C   s5  g  } x3 | j  d d „  ƒ D] } | j | j | ƒ ƒ q W| j } | j } d d g } | | ƒ } | | k } | sjt j d | f d | | f ƒ d t j | ƒ d d	 t j	 ƒ  k sÉ t j
 | ƒ rØ t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d d t j	 ƒ  k st j
 | ƒ r,t j | ƒ n d d t j | ƒ i }	 d d |	 i }
 t t j |
 ƒ ƒ ‚ d  } } } } } d } | | k } | s't j d | f d | | f ƒ d t j | ƒ d d t j	 ƒ  k sét j
 | ƒ røt j | ƒ n d i } d d | i } t t j | ƒ ƒ ‚ d  } } d  S)Nc             S   s   |  j  d d ƒ S)Nr0   Úfile)r=   )rQ   r   r   r   rÅ   Î   s    z3CommonFSTests.test_visit_endswith.<locals>.<lambda>r   rC   rV   úd%(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.sep
}.join
}(%(py6)s)
} in %(py10)sr&   r   r   r   r$   rv   r˜   r   r	   úassert %(py12)srt   r   ú%(py1)s in %(py3)srÀ   r.   úassert %(py5)srH   )rV   )rå   ræ   )rV   )rç   rè   )rÔ   rÕ   rœ   r5   r!   r   r   r   r   r   r   r   r   )r   r   r˜   rÖ   r   r(   r)   r2   ry   r†   r‡   rÂ   rM   rN   rA   r   r   r   Útest_visit_endswithÌ   s(    	 	     Í      j   z!CommonFSTests.test_visit_endswithc          
   C   sƒ  | j  } d } | d | ƒ } | sª d d d t j | ƒ d t j | ƒ d d t j ƒ  k sm t j | ƒ r| t j | ƒ n d d	 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } | j d
 ƒ } | j  } d } | d | ƒ } | sqd d d t j | ƒ d t j | ƒ d d t j ƒ  k s4t j | ƒ rCt j | ƒ n d d	 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } d  S)Nz.pyZnotendswithr	   zSassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(notendswith=%(py4)s)
}r   r$   r   r   r   r   rä   r0   zPassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(endswith=%(py4)s)
}rQ   )	r=   r   r   r   r   r   r   r   r!   )r   r   r   r(   r)   r*   rQ   r   r   r   Útest_endswith_checkÓ   s    	    q  	    q  z!CommonFSTests.test_endswith_checkc             C   sq  | j  d ƒ } | j  d ƒ } | | k  } d } d } | | k  } | | k } | s~t j d | f d | | f ƒ d d t j ƒ  k s– t j | ƒ r¥ t j | ƒ n d d d t j ƒ  k sÌ t j | ƒ rÛ t j | ƒ n d i } t j d | f d | | f ƒ d
 t j | ƒ d t j | ƒ i }	 t j d | f d | | f ƒ d | d |	 i }
 d d |
 i } t t j | ƒ ƒ ‚ d  } } } } } | | k  } | } | sct j d | f d | | f ƒ d d t j ƒ  k sït j | ƒ rþt j | ƒ n d d d t j ƒ  k s%t j | ƒ r4t j | ƒ n d i } d d | i } t t j | ƒ ƒ ‚ d  } } d  S)Nr   r€   ú<ú%(py0)s < %(py2)sr   r   r   Úpath2ú%(py7)s < %(py10)srv   rY   r   ú(%(py4)s) == (%(py12)s)r   rt   r	   úassert %(py14)sru   úassert not %(py4)s)rë   )rì   )rë   )rî   )r   )rï   rð   )rë   )rì   rñ   )	r!   r   r   r   r   r   r   r   r   )r   r   rí   r   rl   ry   r   r)   r   r†   r‡   r|   rA   r   r   r   Útest_cmpØ   s*          ‘ C 1      ‘   zCommonFSTests.test_cmpc             C   sÍ   | j  d ƒ j d ƒ } d } | | k } | s¿ t j d | f d | | f ƒ d d t j ƒ  k sr t j | ƒ r t j | ƒ n d d t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } d  S)Nr   Úrzsamplefile
r   ú%(py0)s == %(py3)sr   rQ   r.   r	   úassert %(py5)srH   )r   )rô   rõ   )
r!   Úreadr   r   r   r   r   r   r   r   )r   r   rQ   rM   r   rN   rA   r   r   r   Útest_simple_readÞ   s       j   zCommonFSTests.test_simple_readc             C   sò   | d d } | j  d d ƒ } | | k } | sè t j d | f d | | f ƒ d d t j ƒ  k st t j | ƒ rƒ t j | ƒ n d d	 d
 t j ƒ  k sª t j | ƒ r¹ t j | ƒ n d
 i } d d | i } t t j | ƒ ƒ ‚ d  } d  S)Nz
/sampledirz/test//r   r»   r   ú%(py0)s == %(py2)sr   r6   r   Únewpath2r	   úassert %(py4)sr   )r   )rø   rú   )	r!   r   r   r   r   r   r   r   r   )r   r   r6   rù   r   r   r   r   r   r   Útest_join_div_operatorâ   s      ‘   z$CommonFSTests.test_join_div_operatorc       	      C   sw  | j  d ƒ } | j } d } | | k } | sÎ t j d | f d | | f ƒ d d t j ƒ  k sr t j | ƒ r t j | ƒ n d d t j | ƒ d t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } } | j  d ƒ } | j } | } | sid	 d d d t j ƒ  k s,t j | ƒ r;t j | ƒ n d d t j | ƒ i } t t j	 | ƒ ƒ ‚ d  } } d  S)Nzsampledir.extz.extr   ú+%(py2)s
{%(py2)s = %(py0)s.ext
} == %(py5)sr   r6   r   rH   r	   úassert %(py7)srY   r   z+assert not %(py2)s
{%(py2)s = %(py0)s.ext
})r   )rü   rý   )
r!   Úextr   r   r   r   r   r   r   r   )	r   r   r6   r   r^   r(   rA   r_   rN   r   r   r   Útest_extç   s     	    y   	   S  zCommonFSTests.test_extc             C   sà   | j  d ƒ } | j } d } | | k } | sÎ t j d | f d | | f ƒ d d t j ƒ  k sr t j | ƒ r t j | ƒ n d d t j | ƒ d t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } } d  S)Nzsamplefile.pyr   r   ú4%(py2)s
{%(py2)s = %(py0)s.purebasename
} == %(py5)sr   r6   r   rH   r	   úassert %(py7)srY   )r   )r   r  )
r!   Úpurebasenamer   r   r   r   r   r   r   r   )r   r   r6   r   r^   r(   rA   r_   r   r   r   Útest_purebasenameí   s    	    y   zCommonFSTests.test_purebasenamec             C   sh  | j  d ƒ } | j d ƒ \ } } } } t | ƒ } | j } | | ƒ }	 |	 sCd d d t j |	 ƒ d d t j ƒ  k s‹ t j t ƒ rš t j t ƒ n d d d	 t j ƒ  k sÁ t j | ƒ rÐ t j | ƒ n d	 d
 d t j ƒ  k s÷ t j | ƒ rt j | ƒ n d d t j | ƒ d t j | ƒ i }
 t	 t j
 |
 ƒ ƒ ‚ d  } } }	 d } | | k } | søt j d | f d | | f ƒ d d t j ƒ  k s«t j | ƒ rºt j | ƒ n d d t j | ƒ i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } d } | | k } | s©t j d | f d | | f ƒ d d t j ƒ  k s\t j | ƒ rkt j | ƒ n d d t j | ƒ i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } d } | | k } | sZt j d | f d | | f ƒ d d t j ƒ  k st j | ƒ rt j | ƒ n d d t j | ƒ i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } d  S)Nzsamplefile.pyz!dirname,purebasename,basename,extr	   zhassert %(py8)s
{%(py8)s = %(py5)s
{%(py5)s = %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}.endswith
}(%(py6)s)
}r&   r   r/   rÀ   r   r$   rk   r.   rH   r   r   ú%(py0)s == %(py3)sr  úassert %(py5)sra   z.pyrþ   )r   )r  r  )r   )r  r  )r   )r  r  )r!   Ú
_getbyspecr/   r0   r   r   r   r   r   r   r   r   )r   r   r6   rk   r  ra   rþ   rM   r^   r2   r+   r   rN   rA   r   r   r   Útest_multiple_partsñ   s>     	   Ý     j   
   j   
   j   z!CommonFSTests.test_multiple_partsc             C   sš  | j  d ƒ } | j } d } | | k } | s¿ t j d | f d | | f ƒ d d t j ƒ  k sr t j | ƒ r t j | ƒ n d d t j | ƒ i } d d
 | i } t t j	 | ƒ ƒ ‚ d  } } | j } d } | | k }	 |	 sˆt j d |	 f d | | f ƒ d d t j ƒ  k s,t j | ƒ r;t j | ƒ n d d t j | ƒ d
 t j | ƒ i } d d | i }
 t t j	 |
 ƒ ƒ ‚ d  } }	 } d  S)Nza.b.cz.cr   ú%(py0)s == %(py3)sr   rþ   r.   r	   úassert %(py5)srH   ú+%(py2)s
{%(py2)s = %(py0)s.ext
} == %(py5)sr6   r   úassert %(py7)srY   )r   )r  r	  )r   )r
  r  )
r!   rþ   r   r   r   r   r   r   r   r   )r   r   r6   rþ   rM   r   rN   rA   r^   r(   r_   r   r   r   Útest_dotted_name_extú   s"    	   j   
	    y   z"CommonFSTests.test_dotted_name_extc       	      C   s¿  | j  d ƒ } | j d d ƒ } | j } d } | | k } | sà t j d | f d | | f ƒ d d t j ƒ  k s„ t j | ƒ r“ t j | ƒ n d d	 t j | ƒ d
 t j | ƒ i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } } | j } d } | | k } | s­t j d | f d | | f ƒ d d t j ƒ  k sQt j | ƒ r`t j | ƒ n d d	 t j | ƒ d
 t j | ƒ i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } } d  S)Nzsamplefile.pyrþ   z.txtzsamplefile.txtr   ú0%(py2)s
{%(py2)s = %(py0)s.basename
} == %(py5)sr   Únewextr   rH   r	   úassert %(py7)srY   r   ú4%(py2)s
{%(py2)s = %(py0)s.purebasename
} == %(py5)s)r   )r  r  )r   )r  r  )r!   r'   ra   r   r   r   r   r   r   r   r   r  )	r   r   r6   r  r   r^   r(   rA   r_   r   r   r   Útest_newext   s$    	    y   	    y   zCommonFSTests.test_newextc             C   sÓ   | j  d ƒ } | j ƒ  } d g } | | k } | sÅ t j d | f d | | f ƒ d d t j ƒ  k sx t j | ƒ r‡ t j | ƒ n d d t j | ƒ i } d d
 | i } t t j	 | ƒ ƒ ‚ d  } } d  S)Nr   zsamplefile
r   ú%(py0)s == %(py3)sr   Úcontentsr.   r	   úassert %(py5)srH   )r   )r  r  )
r!   Ú	readlinesr   r   r   r   r   r   r   r   )r   r   Úfnr  rM   r   rN   rA   r   r   r   Útest_readlines  s    	   j   zCommonFSTests.test_readlinesc             C   sÜ   | j  d ƒ } | j d d ƒ } d d g } | | k } | sÎ t j d | f d | | f ƒ d d t j ƒ  k s t j | ƒ r t j | ƒ n d d	 t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } d  S)Nr   Úcrr   r	   r   ú%(py0)s == %(py3)sr   r  r.   úassert %(py5)srH   )r   )r  r  )
r!   r  r   r   r   r   r   r   r   r   )r   r   r  r  rM   r   rN   rA   r   r   r   Útest_readlines_nocr  s       j   z!CommonFSTests.test_readlines_nocrc       	      C   s  | j  } d } | | ƒ } | j } d } | d | ƒ } | sò d d d t j | ƒ d t j | ƒ d d	 t j ƒ  k sˆ t j | ƒ r— t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } } d  S)Nr   r‹   rä   r	   z‡assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(file=%(py10)s)
}rt   r&   r   r   r   r$   rv   r   )	r!   r=   r   r   r   r   r   r   r   )	r   r   r   r(   r)   r2   ry   rz   r‡   r   r   r   Ú	test_file  s    	   	    ž  zCommonFSTests.test_filec             C   s'  | j  } d } | | ƒ } | j } d } | d | ƒ } | } | sù d d d t j | ƒ d t j | ƒ d d	 t j ƒ  k s t j | ƒ rž t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i }	 t t j |	 ƒ ƒ ‚ d  } } } } } } } | j  } d } | | ƒ } | j } d } | d | ƒ } | s	d d d t j | ƒ d t j | ƒ d d	 t j ƒ  k sŸt j | ƒ r®t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i }
 t t j |
 ƒ ƒ ‚ d  } } } } } } d  S)Nr   r‹   rä   r	   z‹assert not %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(file=%(py10)s)
}rt   r&   r   r   r   r$   rv   r   r   z‡assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(file=%(py10)s)
})	r!   r=   r   r   r   r   r   r   r   )r   r   r   r(   r)   r2   ry   rz   r{   r   r‡   r   r   r   Útest_not_file  s*    	   	     ž  	   	    ž  zCommonFSTests.test_not_filec             C   sW  | j  } d } | | ƒ } | j } d } | d | ƒ } | sò d d d t j | ƒ d t j | ƒ d d	 t j ƒ  k sˆ t j | ƒ r— t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } } | j  } d } | | ƒ } | j } d } | d | ƒ } | sþd d d t j | ƒ d t j | ƒ d d	 t j ƒ  k s”t j | ƒ r£t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } } | j  } d } | | ƒ } | j } d } | d | ƒ } | s
d d d t j | ƒ d t j | ƒ d d	 t j ƒ  k s t j | ƒ r¯t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } } | j  } d } | | ƒ } | j } d } | d | ƒ } | sd d d t j | ƒ d t j | ƒ d d	 t j ƒ  k s¬t j | ƒ r»t j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } } | j  } d } | | ƒ } | j } d } | d | ƒ } | s"d d d t j | ƒ d t j | ƒ d d	 t j ƒ  k s¸t j | ƒ rÇt j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } } } } | j  } d } | | ƒ } | j } d } | d | ƒ } | }	 |	 s5d d d t j | ƒ d t j | ƒ d d	 t j ƒ  k sËt j | ƒ rÚt j | ƒ n d	 d
 t j | ƒ d t j | ƒ d t j | ƒ d t j | ƒ i }
 t t j |
 ƒ ƒ ‚ d  } } } } } } }	 d  S)Nzsampledir.notherer   r<   r	   z†assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(dir=%(py10)s)
}rt   r&   r   r   r   r$   rv   r   rä   z‡assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(file=%(py10)s)
}r‹   ZnotfilezŠassert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(notfile=%(py10)s)
}r   z‰assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(notdir=%(py10)s)
}Z	notexistszŒassert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(notexists=%(py10)s)
}zŽassert not %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(notfile=%(py10)s)
})	r!   r=   r   r   r   r   r   r   r   )r   r   r   r(   r)   r2   ry   rz   r‡   r{   r   r   r   r   Útest_non_existent  sz    	   	    ž  	   	    ž  	   	    ž  	   	    ž  	   	    ž  	   	     ž  zCommonFSTests.test_non_existentc       
      C   sQ  | j  d ƒ } | j } | ƒ  } d } t | ƒ } | | k } | s7t j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k s– t j | ƒ r¥ t j | ƒ n d d t j | ƒ d d	 t j ƒ  k sÛ t j t ƒ rê t j t ƒ n d	 d
 t j | ƒ d t j | ƒ i } d d | i }	 t	 t j
 |	 ƒ ƒ ‚ d  } } } } } d  S)Nr   ú>úb%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.size
}()
} > %(py10)s
{%(py10)s = %(py6)s(%(py8)s)
}r&   r   Úurlr   r$   rÁ   rv   r   r	   úassert %(py12)srt   )r  )r   r"  )r!   ÚsizerÁ   r   r   r   r   r   r   r   r   )
r   r   r!  r   r(   r2   ry   r)   r†   r‡   r   r   r   Ú	test_size#  s    	 	     Í   zCommonFSTests.test_sizec       	   
   C   sü   | j  d ƒ } | j } | ƒ  } d } | | k } | sæ t j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k sŠ t j | ƒ r™ t j | ƒ n d d t j | ƒ d	 t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } } } d  S)Nr   r   r  úC%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.mtime
}()
} > %(py7)sr   r   r!  r   rY   r	   úassert %(py9)srj   )r  )r%  r&  )
r!   Úmtimer   r   r   r   r   r   r   r   )	r   r   r!  r   r(   rl   r)   r_   rm   r   r   r   Ú
test_mtime'  s    	 	    ˆ   zCommonFSTests.test_mtimec             C   s   t  j j t d ƒ d  S)Nzpath1.relto(42))rº   r»   r¼   Ú	TypeError)r   r   r   r   r   Útest_relto_wrong_type+  s    z#CommonFSTests.test_relto_wrong_typec             C   sc  | j  d ƒ } | j ƒ  } t | ƒ } | t k } | s4t j d | f d | t f ƒ d d t j ƒ  k s{ t j t ƒ rŠ t j	 t ƒ n d d d t j ƒ  k s± t j | ƒ rÀ t j	 | ƒ n d d d	 t j ƒ  k sç t j t ƒ rö t j	 t ƒ n d	 d
 t j	 | ƒ i } d d | i } t
 t j | ƒ ƒ ‚ d  } } | j } d }	 d  }
 | |	 |
 ƒ } d } | | k } | sEt j d | f d | | f ƒ d t j	 | ƒ d d t j ƒ  k sËt j | ƒ rÚt j	 | ƒ n d d t j	 |	 ƒ d t j	 |
 ƒ d t j	 | ƒ d t j	 | ƒ i } d d | i } t
 t j | ƒ ƒ ‚ d  } }	 }
 } } } d  S)NrÎ   Úisú0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} is %(py5)srH   ÚdictrÀ   Úobjr   Útyper.   r	   úassert %(py7)srY   Úansweré*   r   úS%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s)
} == %(py11)sr&   r   r$   r™   r   úassert %(py13)sr—   )r+  )r,  r0  )r   )r3  r4  )r!   Úloadr/  r-  r   r   r   r   r   r   r   r   Úget)r   r   r   r.  rM   r^   rA   r_   r   r(   r)   r2   rž   ry   r‰   r   r   r   r   Ú	test_load.  s(       Ö   
	       ¦   zCommonFSTests.test_loadc             C   s5  g  } x3 | j  d d „  ƒ D] } | j | j | ƒ ƒ q Wd } | | k } | sã t j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k s¥ t j | ƒ r´ t j | ƒ n d i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } | j } | j }	 d d g }
 |	 |
 ƒ } | | k } | st j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k szt j | ƒ r‰t j | ƒ n d d t j |	 ƒ d t j |
 ƒ d d t j ƒ  k sÎt j | ƒ rÝt j | ƒ n d d t j | ƒ i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } }	 }
 } } d  S)Nc             S   s   |  j  d d ƒ S)Nrä   r‹   )r=   )rQ   r   r   r   rÅ   6  s    z4CommonFSTests.test_visit_filesonly.<locals>.<lambda>r   únot inú%(py1)s not in %(py3)srÀ   r.   r˜   r	   úassert %(py5)srH   rC   rV   úd%(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.sep
}.join
}(%(py6)s)
} in %(py10)sr&   r   r   r   r$   rv   r   úassert %(py12)srt   )r8  )r9  r:  )rV   )r;  r<  )rÔ   rÕ   rœ   r   r   r   r   r   r   r   r   r5   r!   )r   r   r˜   rÖ   rÂ   rM   rN   rA   r   r(   r)   r2   ry   r†   r‡   r   r   r   Útest_visit_filesonly4  s(       j   
	 	     Í   z"CommonFSTests.test_visit_filesonlyc             C   sæ  g  } x3 | j  d d „  ƒ D] } | j | j | ƒ ƒ q Wd } | | k } | sã t j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k s¥ t j | ƒ r´ t j | ƒ n d i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } } | j } | j }	 d d g }
 |	 |
 ƒ } | | k } | st j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k szt j | ƒ r‰t j | ƒ n d d t j |	 ƒ d t j |
 ƒ d d t j ƒ  k sÎt j | ƒ rÝt j | ƒ n d d t j | ƒ i } d d | i } t	 t j
 | ƒ ƒ ‚ d  } }	 }
 } } d } | | k } | sØt j d  | f d! | | f ƒ d t j | ƒ d d t j ƒ  k sšt j | ƒ r©t j | ƒ n d i } d" d | i } t	 t j
 | ƒ ƒ ‚ d  } } d  S)#Nc             S   s   |  j  d d ƒ S)NÚdotfiler   )r=   )rQ   r   r   r   rÅ   =  s    z5CommonFSTests.test_visit_nodotfiles.<locals>.<lambda>r   rV   ú%(py1)s in %(py3)srÀ   r.   r˜   r	   úassert %(py5)srH   rC   úd%(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.sep
}.join
}(%(py6)s)
} in %(py10)sr&   r   r   r   r$   rv   r   úassert %(py12)srt   z.dotfiler8  ú%(py1)s not in %(py3)s)rV   )r?  r@  )rV   )rA  rB  )r8  )rC  r@  )rÔ   rÕ   rœ   r   r   r   r   r   r   r   r   r5   r!   )r   r   r˜   rÖ   rÂ   rM   rN   rA   r   r(   r)   r2   ry   r†   r‡   r   r   r   Útest_visit_nodotfiles;  s6       j   
	 	     Í      j   z#CommonFSTests.test_visit_nodotfilesc          
   C   sk  g  } x0 | j  d d ƒ D] } | j | j | ƒ ƒ q Wx+t | ƒ D]\ } } | j | k rF xî t | t | ƒ ƒ D]× } | j } | | } | | k } | s@t j d | f d | | f ƒ d d t	 j
 ƒ  k sä t j | ƒ ró t j | ƒ n d d t j | ƒ d t j | ƒ i }	 d d |	 i }
 t t j |
 ƒ ƒ ‚ d  } } } qw WPqF Wt j j d ƒ d  S)NÚbfTrV   ú+%(py2)s
{%(py2)s = %(py0)s.sep
} in %(py5)sr   r   r   rH   r	   úassert %(py7)srY   Zhuh)rV   )rF  rG  )rÔ   rÕ   rœ   Ú	enumerater5   ÚrangerÁ   r   r   r   r   r   r   r   r   rº   r»   Úfail)r   r   r˜   rÖ   r   Újr   r^   r(   rA   r_   r   r   r   Útest_visit_breadthfirstC  s     	 
   y   z%CommonFSTests.test_visit_breadthfirstc          
   C   sj  g  } x6 | j  d d d d ƒ D] } | j | j | ƒ ƒ q Wx* t | ƒ D] \ } } | j | k rL PqL W| d  | … } | d  | … } t | ƒ } | | k } | sWt j d | f d | | f ƒ d t j | ƒ d t j | ƒ d d	 t	 j
 ƒ  k s
t j t ƒ rt j t ƒ n d	 d
 t j | ƒ i }	 d d |	 i }
 t t j |
 ƒ ƒ ‚ d  } } } } | | d  … } | | d  … } t | ƒ } | | k } | sTt j d | f d | | f ƒ d t j | ƒ d t j | ƒ d d	 t	 j
 ƒ  k st j t ƒ rt j t ƒ n d	 d
 t j | ƒ i }	 d d |	 i }
 t t j |
 ƒ ƒ ‚ d  } } } } d  S)NrE  TrË   r   ú0%(py1)s == %(py7)s
{%(py7)s = %(py3)s(%(py5)s)
}rÀ   rY   r.   ÚsortedrH   r	   úassert %(py9)srj   )r   )rM  rO  )r   )rM  rO  )rÔ   rÕ   rœ   rH  r5   rN  r   r   r   r   r   r   r   r   )r   r   r˜   rÖ   r   rÂ   r^   rl   rM   r_   rm   r   r   r   Útest_visit_sortO  s0         ˆ        ˆ   zCommonFSTests.test_visit_sortc             C   sð  d d „  } | | ƒ } | } | sÃ d d d d t  j ƒ  k sP t j | ƒ r_ t j | ƒ n d d d t  j ƒ  k s† t j | ƒ r• t j | ƒ n d d	 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } | j } d
 } | | ƒ } | | ƒ } | } | sÌd d d t j | ƒ d d t  j ƒ  k s;t j | ƒ rJt j | ƒ n d d	 t j | ƒ d d t  j ƒ  k s€t j | ƒ rt j | ƒ n d d t j | ƒ d t j | ƒ i }	 t t j |	 ƒ ƒ ‚ d  } } } } } | j } d } | | ƒ } | | ƒ } | sÚd d d t j | ƒ d d t  j ƒ  k sIt j | ƒ rXt j | ƒ n d d	 t j | ƒ d d t  j ƒ  k sŽt j | ƒ rt j | ƒ n d d t j | ƒ d t j | ƒ i }
 t t j |
 ƒ ƒ ‚ d  } } } } d  S)Nc             S   s   |  j  d d ƒ S)Nr0   Úpickle)r=   )r   r   r   r   ÚchkZ  s    z(CommonFSTests.test_endswith.<locals>.chkr	   z0assert not %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}rÀ   r   r   rR  r.   r   zhassert not %(py9)s
{%(py9)s = %(py0)s(%(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.join
}(%(py5)s)
})
}rj   rY   rH   Z
somepicklezdassert %(py9)s
{%(py9)s = %(py0)s(%(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.join
}(%(py5)s)
})
})r   r   r   r   r   r   r   r!   )r   r   rR  rM   r^   r   rl   r   rž   r†   rm   r   r   r   Útest_endswithY  s0       ‰  
	      ¶  	     ¶  zCommonFSTests.test_endswithc             C   sÛ  | j  d ƒ } | j  d ƒ } | j  d ƒ } | j | ƒ zƒ| j } | ƒ  } | sÌ d d d t j | ƒ d d t j ƒ  k s t j | ƒ rž t j | ƒ n d d t j | ƒ i } t t j	 | ƒ ƒ ‚ d  } } | j
 ƒ  } | j
 ƒ  }	 | |	 k } | s¶t j d | f d | |	 f ƒ d d t j ƒ  k sBt j | ƒ rQt j | ƒ n d d d t j ƒ  k sxt j |	 ƒ r‡t j |	 ƒ n d i }
 d d |
 i } t t j	 | ƒ ƒ ‚ d  } Wd  | j ƒ  rÖ| j ƒ  Xd  S)Nrß   z__init__.pyÚcopiedr	   z@assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}r   r   r   r   ú%(py0)s == %(py2)sÚs1Ús2úassert %(py4)s)r   )rU  rX  )r!   Úcopyr=   r   r   r   r   r   r   r   rö   r   Úremove)r   r   rß   ZinitpyrT  r   r(   r   rV  rW  r   r   r   r   Útest_copy_file`  s*    	 	  b  
  ‘   
zCommonFSTests.test_copy_filec             C   s  | j  d ƒ } | j  d ƒ } zÍ| j | ƒ | j } d } | d | ƒ } | sØ d d d t j | ƒ d t j | ƒ d	 d
 t j ƒ  k s› t j | ƒ rª t j | ƒ n d
 d t j | ƒ i } t t j	 | ƒ ƒ ‚ d  } } } | j  } d } | | ƒ } | j } d }	 | d |	 ƒ }
 |
 sØd d d t j |
 ƒ d t j | ƒ d	 d
 t j ƒ  k snt j | ƒ r}t j | ƒ n d
 d t j | ƒ d t j | ƒ d t j |	 ƒ d t j | ƒ i } t t j	 | ƒ ƒ ‚ d  } } } } }	 }
 | j  d ƒ j
 ƒ  } | j  d ƒ j
 ƒ  } | | k } | sät j d | f d | | f ƒ d	 d t j ƒ  k spt j | ƒ rt j | ƒ n d d d t j ƒ  k s¦t j | ƒ rµt j | ƒ n d i } d d | i } t t j	 | ƒ ƒ ‚ d  } Wd  | j d d ƒ r| j d d ƒ Xd  S)Nrß   Znewdirr‹   r<   r	   zKassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(dir=%(py4)s)
}r   r$   r   rT  r   z__init__.pyrä   z‡assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(file=%(py10)s)
}rt   r&   rv   r   ú%(py0)s == %(py2)srV  rW  úassert %(py4)sÚrec)r   )r\  r]  )r!   rY  r=   r   r   r   r   r   r   r   rö   r   rZ  )r   r   rß   rT  r   r(   r)   r*   r2   ry   rz   r‡   rV  rW  r   r   r   r   r   Útest_copy_dirn  s>    	    q  	   	    ž    ‘   
zCommonFSTests.test_copy_dirc             C   sZ  | j  d ƒ } | j } | ƒ  } | sž d d d t j | ƒ d d t j ƒ  k sa t j | ƒ rp t j | ƒ n d d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } | j	 ƒ  | j } | ƒ  } | } | sHd d d t j | ƒ d d t j ƒ  k st j | ƒ rt j | ƒ n d d t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } d  S)	NZ	todeletedr	   z@assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}r   r   Údr   zDassert not %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
})
Úensurer=   r   r   r   r   r   r   r   rZ  )r   r   r`  r   r(   r   r)   rA   r   r   r   Útest_remove_file|  s    	 	  b  

	 	   b  zCommonFSTests.test_remove_filec       	      C   so  | j  d d d ƒ } | j } | ƒ  } | s¤ d d d t j | ƒ d d t j ƒ  k sg t j | ƒ rv t j | ƒ n d d	 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } | j	 d ƒ } | j
 ƒ  | j } | ƒ  } | } | s]d d
 d t j | ƒ d d t j ƒ  k s t j | ƒ r/t j | ƒ n d d	 t j | ƒ i } t t j | ƒ ƒ ‚ d  } } } d  S)NZtoÚbeÚdeletedr	   z@assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}r   r   r`  r   zDassert not %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}r   )ra  r=   r   r   r   r   r   r   r   r!   rZ  )	r   r   r`  r   r(   r   r   r)   rA   r   r   r   Ú$test_remove_dir_recursive_by_default‚  s     	 	  b  

	 	   b  z2CommonFSTests.test_remove_dir_recursive_by_defaultc       	      C   s|  | j  d d ƒ } | j } d } | | k } | sÑ t j d | f d | | f ƒ d d t j ƒ  k su t j | ƒ r„ t j | ƒ n d d t j | ƒ d t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } } | j
 } | ƒ  } | snd	 d d t j | ƒ d d t j ƒ  k s1t j | ƒ r@t j | ƒ n d d t j | ƒ i } t t j	 | ƒ ƒ ‚ d  } } d  S)NZ001Z002r   ú0%(py2)s
{%(py2)s = %(py0)s.basename
} == %(py5)sr   r³   r   rH   r	   úassert %(py7)srY   z@assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.isdir
}()
}r   )r   )rf  rg  )Ú
ensure_dirra   r   r   r   r   r   r   r   r   r?   )	r   r   r³   r   r^   r(   rA   r_   r   r   r   r   Útest_ensure_dir‰  s    	    y   	 	  b  zCommonFSTests.test_ensure_dirc             C   s÷  | } t  j j t  j j | j d ƒ | j d ƒ } | j ƒ  | j } d } | d | ƒ } | sè d d d t j	 | ƒ d t j	 | ƒ d	 d
 t
 j ƒ  k s« t j | ƒ rº t j	 | ƒ n d
 d t j	 | ƒ i } t t j | ƒ ƒ ‚ d  } } } | j ƒ  | j d ƒ } | j } d } | d | ƒ } | s¹d d d t j	 | ƒ d t j	 | ƒ d	 d
 t
 j ƒ  k s|t j | ƒ r‹t j	 | ƒ n d
 d t j	 | ƒ i } t t j | ƒ ƒ ‚ d  } } } | j ƒ  | j } d } | | ƒ } | | k } | sát j d | f d | | f ƒ d t j	 | ƒ d t j	 | ƒ d	 d t
 j ƒ  k s^t j | ƒ rmt j	 | ƒ n d d d
 t
 j ƒ  k s”t j | ƒ r£t j	 | ƒ n d
 d t j	 | ƒ i }	 d d |	 i }
 t t j |
 ƒ ƒ ‚ d  } } } } d  S)Nr   Zmktest1r‹   r<   r	   zKassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(dir=%(py4)s)
}r   r$   r   r'   r   Zmktestr   úJ%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
} == %(py8)sÚtmpdirr&   úassert %(py10)srv   )r   )rj  rl  )rº   r»   r¼   r½   ÚEEXISTÚmkdirr!   r=   r   r   r   r   r   r   r   rZ  r   )r   r   rk  r'   r   r(   r)   r*   r2   r+   r†   r   r   r   Útest_mkdir_and_removeŽ  s<    
	    q  
	    q  
	     ¾   z#CommonFSTests.test_mkdir_and_removec             C   sa  | j  d ƒ } | j d ƒ } | j | ƒ z`| j } d } | d | ƒ } | sØ d d d t j | ƒ d t j | ƒ d	 d
 t j ƒ  k s› t j | ƒ rª t j | ƒ n d
 d t j | ƒ i } t	 t j
 | ƒ ƒ ‚ d  } } } | j } | ƒ  } | } | s|d d d t j | ƒ d	 d t j ƒ  k s?t j | ƒ rNt j | ƒ n d d t j | ƒ i } t	 t j
 | ƒ ƒ ‚ d  } } } Wd  | j ƒ  }	 t |	 d ƒ r¶|	 j ƒ  n¦ | j | ƒ | j } | ƒ  } | sRd d d t j | ƒ d	 d t j ƒ  k st j | ƒ r$t j | ƒ n d d t j | ƒ i }
 t	 t j
 |
 ƒ ƒ ‚ d  } } Xd  S)Nr   Zmoved_samplefiler‹   rä   r	   zLassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(file=%(py4)s)
}r   r$   r   Únewpr   zDassert not %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}r   Úrevertz@assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
})r!   rq   Úmover=   r   r   r   r   r   r   r   Úhasattrrq  )r   r   r   rp  r   r(   r)   r*   rA   Údpr   r   r   r   Útest_move_file›  s8    	    q  	 	   b  	 	  b  zCommonFSTests.test_move_filec             C   së  | j  d ƒ } | j  d ƒ } | j | ƒ | j } d } | d | ƒ } | sÕ d d d t j | ƒ d t j | ƒ d	 d
 t j ƒ  k s˜ t j | ƒ r§ t j | ƒ n d
 d t j | ƒ i } t t j	 | ƒ ƒ ‚ d  } } } | j  } d } | | ƒ } | j } d }	 | d |	 ƒ }
 |
 sÕd d d t j |
 ƒ d t j | ƒ d	 d
 t j ƒ  k skt j | ƒ rzt j | ƒ n d
 d t j | ƒ d t j | ƒ d t j |	 ƒ d t j | ƒ i } t t j	 | ƒ ƒ ‚ d  } } } } }	 }
 | j  } d } | | ƒ } | j } | ƒ  }	 |	 }
 |
 sÍd d d t j | ƒ d	 d t j ƒ  k sct j | ƒ rrt j | ƒ n d d t j | ƒ d t j | ƒ d t j |	 ƒ d t j | ƒ i } t t j	 | ƒ ƒ ‚ d  } } } } }	 }
 d  S)Nr   Zmoveddirr‹   r<   r	   zKassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(dir=%(py4)s)
}r   r$   r   Údestr   rC   rä   z‡assert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(file=%(py10)s)
}rt   r&   rv   z~assert not %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}()
}Úsource)
r!   rr  r=   r   r   r   r   r   r   r   )r   r   rw  rv  r   r(   r)   r*   r2   ry   rz   r‡   r‰   r   r   r   Útest_move_dirª  s<    	    q  	   	    ž  	   	 	     zCommonFSTests.test_move_dirc             C   s&  | j  } | ƒ  } | j } | | k } | st j d | f d | | f ƒ d t j | ƒ d d t j ƒ  k s~ t j | ƒ r t j | ƒ n d d d t j ƒ  k s´ t j | ƒ rÃ t j | ƒ n d d t j | ƒ d t j | ƒ i } d d | i } t t j	 | ƒ ƒ ‚ d  } } } } d  S)Nr   úf%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.__fspath__
}()
} == %(py8)s
{%(py8)s = %(py6)s.strpath
}r   r$   r   r   r&   r   r	   úassert %(py10)srv   )r   )ry  rz  )
Ú
__fspath__Ústrpathr   r   r   r   r   r   r   r   )r   r   r   r(   r2   r)   r+   r†   r   r   r   Ú"test_fspath_protocol_match_strpath²  s    	 	 	   ¾   z0CommonFSTests.test_fspath_protocol_match_strpathc             C   s|  y d d l  m } Wn" t k
 r8 d d l m } Yn X| | ƒ } | j } | | k } | sjt j d | f d | | f ƒ d d t j ƒ  k s¢ t j	 | ƒ r± t j
 | ƒ n d d d t j ƒ  k sØ t j	 | ƒ rç t j
 | ƒ n d d t j
 | ƒ d	 d
 t j ƒ  k st j	 | ƒ r,t j
 | ƒ n d
 d t j
 | ƒ i } d d | i } t t j | ƒ ƒ ‚ d  } } } d  S)Nr   )Úfspathr   úM%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py7)s
{%(py7)s = %(py5)s.strpath
}rH   r   rÀ   rY   r   r~  r.   r	   úassert %(py9)srj   )r   )r  r€  )Úosr~  ÚImportErrorZpy._path.commonr|  r   r   r   r   r   r   r   r   )r   r   r~  rM   rl   r^   r_   rm   r   r   r   Útest_fspath_func_match_strpathµ  s     	   å   z,CommonFSTests.test_fspath_func_match_strpathzsys.version_info < (3,6)c             C   s   | j  d ƒ } t | ƒ d  S)NZopentestfile)r!   Úopen)r   r   Úfr   r   r   Útest_fspath_open¼  s    zCommonFSTests.test_fspath_openc       	      C   s³  d d l  m } | | ƒ } | j } | | ƒ } | | k } | rt j d f | f d f | | f ƒ d t j | ƒ d t j | ƒ d d t j ƒ  k p§ t j | ƒ r¹ t j | ƒ n d d	 d
 t j ƒ  k pÝ t j | ƒ rï t j | ƒ n d
 d d
 t j ƒ  k pt j | ƒ r%t j | ƒ n d
 d t j | ƒ d d t j ƒ  k pXt j | ƒ rjt j | ƒ n d i } d d d | i } t	 t j
 | ƒ ƒ ‚ d  } } } } d  S)Nr   )Úfsencoder   zm%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py10)s
{%(py10)s = %(py5)s(%(py8)s
{%(py8)s = %(py6)s.strpath
})
}rv   r&   r   r‡  rÀ   r   r$   r.   rH   r	   zassert %(py12)srt   )r  r‡  r|  r   r   r   r   r   r   r   r   )	r   r   r‡  rM   r2   ry   r^   r†   r‡   r   r   r   Útest_fspath_fsencodeÁ  s     	    ÿ 1   z"CommonFSTests.test_fspath_fsencodeN)LÚ__name__Ú
__module__Ú__qualname__r   r"   r,   r3   r7   r:   rB   rO   rU   r`   re   rg   rn   rr   r~   rˆ   rŠ   rŒ   r‘   r“   r–   r£   r²   r¶   rº   r»   ÚmarkÚxfailr¿   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*  r7  r=  rD  rL  rP  rS  r[  r_  rb  re  ri  ro  ru  rx  r}  rƒ  Úskipr†  rˆ  r   r   r   r   r      sˆ   
	!!	
!r   c             C   sƒ  |  j  d ƒ j ƒ  r d  St d |  f ƒ |  j d ƒ } | j d ƒ |  j d ƒ } | j d ƒ |  j d ƒ } | j d ƒ d d d	 d
 d d i } |  j d ƒ j | ƒ |  j d d d ƒ} | j d ƒ |  j d d d ƒ} | j d ƒ | j d ƒ } t j d k r| j d ƒ n | j d ƒ | j d ƒ } | j d ƒ | j d ƒ }	 |	 j d ƒ | j d ƒ }
 |
 j d ƒ d  S)Nr   zsetting up test fs for %rzsamplefile
Úexecfilezx=42zexecfile.pyr‹   r4   r¨   r©   r1  r2  rÎ   r   r<   rC   rß   z__init__.pyza.pyé   zfrom .b import stuff as result
zfrom b import stuff as result
zb.pyzstuff="got it"
zc.pyz7import py;
import otherdir.a
value = otherdir.a.result
zd.pyz4import py;
from otherdir import a
value2 = a.result
)r4   r  )r!   r=   rŽ   ra  ÚwriteÚdumpÚsysÚversion_info)Úpathr   r  Z
execfilepyr`  r   rß   Zmodule_aZmodule_bZmodule_cZmodule_dr   r   r   ÚsetuptestfsÇ  s6    r–  )Úbuiltinsr   Ú_pytest.assertion.rewriteÚ	assertionÚrewriter   rº   r“  Úobjectr   r–  r   r   r   r   Ú<module>   s     ÿ Ã