ó
ä‰ãWc           @   s;   d  d l  Z  d  d l Z d e f d „  ƒ  YZ d „  Z d S(   iÿÿÿÿNt   CommonFSTestsc           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 d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e j j j d ƒ d „  ƒ Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d „  Z" e j j j d ƒ 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+ „  Z0 d, „  Z1 d- „  Z2 d. „  Z3 d/ „  Z4 d0 „  Z5 d1 „  Z6 d2 „  Z7 d3 „  Z8 d4 „  Z9 d5 „  Z: d6 „  Z% d7 „  Z; d8 „  Z< d9 „  Z= d: „  Z> d; „  Z? d< „  Z@ d= „  ZA d> „  ZB d? „  ZC d@ „  ZD e j j jE dA ƒ dB „  ƒ ZF e j j jE dA ƒ dC „  ƒ ZG RS(D   c         C   s%   | j  | ƒ } | | k s! t ‚ d  S(   N(   t	   __class__t   AssertionError(   t   selft   path1t   p(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_constructor_equality   s    c         C   s4   | j  d ƒ } | j  d ƒ } | | k s0 t ‚ d  S(   Nt	   sampledir(   t   joinR   (   R   R   t   p1t   p2(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_eq_nonstring	   s    c         C   s   | | j  ƒ  k s t ‚ d  S(   N(   t   newR   (   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_new_identical   s    c         C   sO   | j  d ƒ } t | ƒ } | j d ƒ s0 t ‚ | j t | ƒ ƒ sK t ‚ d  S(   NR   (   R   t   strt   endswithR   t
   startswith(   R   R   R   t   strp(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt	   test_join   s    c         C   s¬   | j  | j d ƒ } t | ƒ } | j d ƒ s7 t ‚ | j t | ƒ ƒ sR t ‚ | j  | j d d ƒ } t | ƒ } | j d ƒ s t ‚ | j t | ƒ ƒ s¨ t ‚ d  S(   NR   i   (   R   t   sepR   R   R   R   (   R   R   t   newpathR   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_join_normalized   s    c         C   s"   | j  ƒ  } | | k s t ‚ d  S(   N(   R   R   (   R   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_join_noargs!   s    c         C   sf   | j  d ƒ } | d } | j ƒ  s+ t ‚ | j ƒ  s= t ‚ | j ƒ  sO t ‚ | j ƒ  sb t ‚ d  S(   Nt   samplet   dir(   R   t   checkR   t   existst   isdirt   isfile(   R   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_add_something%   s    
c         C   s„   | j  d d ƒ } | j ƒ  d } | | | j  d ƒ | g k sF t ‚ | j d t ƒ d  } | | | j  d ƒ | g k s€ t ‚ d  S(   NR   t	   otherfileiýÿÿÿt   reversei   (   R   t   partsR   t   True(   R   R   R   t   part   revpar(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt
   test_parts-   s
    $c         C   s4   | j  d ƒ } | j | ƒ } | | k s0 t ‚ d  S(   NR   (   R   t   commonR   (   R   R   t   othert   x(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_common5   s    c         C   sX   | j  d ƒ } | j d d ƒ s' t ‚ | j d d ƒ s? t ‚ | j d k sT t ‚ d  S(   NR   t   basenamet   notbasenamet   xyz(   R   R   R   R)   (   R   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_basename_checks?   s    c         C   s@   | j  d ƒ } | j d d ƒ s' t ‚ | j s< t d ƒ ‚ d  S(   NR   R)   (   R   R   R   R)   (   R   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_basenameE   s    c         C   s.   | j  d ƒ } | j t | ƒ k s* t ‚ d  S(   NR   (   R   t   dirnameR   R   (   R   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_dirnameJ   s    c         C   s+   | j  d ƒ } | j ƒ  | k s' t ‚ d  S(   NR   (   R   t   dirpathR   (   R   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_dirpathN   s    c         C   s7   | j  d ƒ } | j d ƒ | j  d ƒ k s3 t ‚ d  S(   NR   R'   (   R   R0   R   (   R   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_dirpath_with_argsR   s    c         C   sX   | j  d ƒ } | j d d ƒ } | j d k s6 t ‚ | j ƒ  | j ƒ  k sT t ‚ d  S(   Nt
   samplefileR)   t   samplefile2(   R   R   R)   R   R0   (   R   R   R   t   newbase(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_newbasenameV   s    c         C   sA   | j  d ƒ j ƒ  s t ‚ | j  d ƒ j d d ƒ s= t ‚ d  S(   Nt   does_not_existR   i    (   R   R   R   (   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_not_exists\   s    c         C   s’   | j  d ƒ j ƒ  s t ‚ | j  d ƒ j d d ƒ s< t ‚ | j  d ƒ j ƒ  sW t ‚ | j  d ƒ j ƒ  sr t ‚ | j  d ƒ j ƒ  sŽ t ‚ d  S(   NR3   R   i   (   R   R   R   R   R   R   (   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_exists`   s
    !c         C   sº   | j  d ƒ j d d ƒ s! t ‚ | j  d ƒ j d d ƒ sB t ‚ | j  d ƒ j d d ƒ sd t ‚ | j  d ƒ j ƒ  s t ‚ | j  d ƒ j ƒ  s› t ‚ | j  d ƒ j ƒ  s¶ t ‚ d  S(   NR   R   i   R3   t   notdir(   R   R   R   R   R   R   (   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_dirg   s    !!"c         C   s„   | j  d ƒ j d d ƒ s! t ‚ | j  d ƒ j d ƒ s? t ‚ | j  d ƒ j d ƒ s^ t ‚ | j  d ƒ j d d ƒ s€ t ‚ d  S(   NR3   t   fnmatchs   s*es   s*x(   R   R   R   R<   (   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_fnmatch_filep   s    !c         C   sŒ   | j  d d ƒ } | j | ƒ | j j  d d g ƒ k s? t ‚ | j d | ƒ sW t ‚ | j d | ƒ so t ‚ | j d | ƒ sˆ t ‚ d  S(   NR   R   t   reltot   notrelto(   R   R>   R   R   R   (   R   R   t   l(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt
   test_relto|   s
    -c         C   sÝ   | } | j  } | j | ƒ } | d k s0 t ‚ | j | j d d ƒ ƒ } | d | d k se t ‚ | j | j ƒ  j d ƒ ƒ } | d | d k s t ‚ | j | j ƒ  ƒ d k s¾ t ‚ | j d ƒ d k sÙ t ‚ d  S(   Nt   .t   hellot   worldt   sisters   ..(   R   t   bestrelpathR   R   R0   (   R   R   t   curdirR   t   s(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_bestrelpathƒ   s    	!c         C   sN   | j  d ƒ } | j  d ƒ } | j | ƒ s4 t ‚ | j | ƒ sJ t ‚ d  S(   Nt   bcdet   b(   R   R>   R   (   R   R   t   l1t   l2(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_relto_not_relative‘   s    s   sys.platform.startswith('java')c         C   s_   | j  ƒ  } | j d ƒ | k s' t ‚ | j d ƒ | k sB t ‚ t j j t j j d ƒ d  S(   NR   R3   s"   path1.join('samplefile').listdir()(   t   listdirR   R   t   pyt   testt   raisest   errort   ENOTDIR(   R   R   R@   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_listdir—   s
    c         C   sD   | j  d ƒ } t | ƒ s! t ‚ | d s@ t | j d ƒ ƒ ‚ d  S(   Ns   s*diri    R   (   RO   t   lenR   R   (   R   R   R@   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_listdir_fnmatchstringŸ   s    c         C   sL   | j  d „  ƒ } | j d ƒ | k s- t ‚ | j d ƒ | k sH t ‚ d  S(   Nc         S   s   |  j  d d ƒ S(   NR   i   (   R   (   R'   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   <lambda>¥   s    R   R3   (   RO   R   R   (   R   R   R@   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_listdir_filter¤   s    c         C   sy   | j  d „  d t ƒ} | j d ƒ | d k s7 t ‚ | j d ƒ | d k sV t ‚ | j d ƒ | d k su t ‚ d  S(	   Nc         S   s   |  j  d d ƒ S(   Nt
   basestartsR   (   R   (   R'   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyRX   ª   s    t   sortR   i    R3   i   t   samplepicklei   (   RO   R!   R   R   (   R   R   R@   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_listdir_sorted©   s    c         C   sm   g  } x* | j  ƒ  D] } | j | j | ƒ ƒ q Wd | k sE t ‚ | j j d d g ƒ | k si t ‚ d  S(   NR   R   (   t   visitt   appendR>   R   R   R   (   R   R   R@   t   i(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_visit_nofilter¯   s
    c         C   sv   g  } x3 | j  d  d „  ƒ D] } | j | j | ƒ ƒ q Wd | k sN t ‚ | j j d d g ƒ | k sr t ‚ d  S(   Nc         S   s   |  j  d k S(   NR   (   R)   (   R'   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyRX   ¸   s    R   R   (   R^   t   NoneR_   R>   R   R   R   (   R   R   R@   R`   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_visit_norecurse¶   s
    c         C   sv   g  } x- | j  d ƒ D] } | j | j | ƒ ƒ q Wt | ƒ sN t d ƒ ‚ d | k s` t ‚ d | k sr t ‚ d  S(   Ns   *diri   R   t   otherdir(   R^   R_   R>   RV   R   (   R   R   R@   R`   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_visit_filterfunc_is_string½   s    c         C   s=   | j  d ƒ } t | j d t j j ƒ ƒ g  k s9 t ‚ d  S(   Nt   nonexistingt   ignore(   R   t   listR^   RP   RS   t   ENOENTR   (   R   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_visit_ignoreÅ   s    c         C   ss   g  } x0 | j  d „  ƒ D] } | j | j | ƒ ƒ q W| j j d d g ƒ | k s] t ‚ d | k so t ‚ d  S(   Nc         S   s   |  j  d d ƒ S(   NR   t   file(   R   (   R'   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyRX   Ì   s    R   R   R3   (   R^   R_   R>   R   R   R   (   R   R   R@   R`   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_visit_endswithÊ   s
    $c         C   sC   | j  d d ƒ s t ‚ | j d ƒ } | j  d d ƒ s? t ‚ d  S(   Nt   notendswiths   .pyR3   R   Rk   (   R   R   R   (   R   R   R'   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_endswithÑ   s    c         C   sS   | j  d ƒ } | j  d ƒ } | | k  d d k  k s< t ‚ | | k  sO t ‚ d  S(   NR3   R4   (   R   R   (   R   R   t   path2(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_cmpÖ   s    c         C   s.   | j  d ƒ j d ƒ } | d k s* t ‚ d  S(   NR3   t   rs   samplefile
(   R   t   readR   (   R   R   R'   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_simple_readÜ   s    c         C   s6   | d d } | j  d d ƒ } | | k s2 t ‚ d  S(   Ns
   /sampledirs   /test//R   RQ   (   R   R   (   R   R   R   t   newpath2(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_join_div_operatorà   s    c         C   sG   | j  d ƒ } | j d k s$ t ‚ | j  d ƒ } | j sC t ‚ d  S(   Ns   sampledir.exts   .extR   (   R   t   extR   (   R   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_extå   s    c         C   s(   | j  d ƒ } | j d k s$ t ‚ d  S(   Ns   samplefile.pyR3   (   R   t   purebasenameR   (   R   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_purebasenameë   s    c         C   s   | j  d ƒ } | j d ƒ \ } } } } t | ƒ j | ƒ sE t ‚ | d k sW t ‚ | d k si t ‚ | d k s{ t ‚ d  S(   Ns   samplefile.pys!   dirname,purebasename,basename,extR3   s   .py(   R   t
   _getbyspecR   R   R   (   R   R   R   R.   Rx   R)   Rv   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_multiple_partsï   s    c         C   sC   | j  d ƒ } | j } | d k s* t ‚ | j d k s? t ‚ d  S(   Ns   a.b.cs   .c(   R   Rv   R   (   R   R   R   Rv   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_dotted_name_extø   s    	c         C   sO   | j  d ƒ } | j d d ƒ } | j d k s6 t ‚ | j d k sK t ‚ d  S(   Ns   samplefile.pyRv   s   .txts   samplefile.txtR3   (   R   R   R)   R   Rx   (   R   R   R   t   newext(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_newextþ   s    c         C   s4   | j  d ƒ } | j ƒ  } | d g k s0 t ‚ d  S(   NR3   s   samplefile
(   R   t	   readlinesR   (   R   R   t   fnt   contents(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_readlines  s    c         C   s=   | j  d ƒ } | j d d ƒ } | d d g k s9 t ‚ d  S(   NR3   t   cri    t    (   R   R   R   (   R   R   R€   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_readlines_nocr	  s    c         C   s%   | j  d ƒ j d d ƒ s! t ‚ d  S(   NR3   Rk   i   (   R   R   R   (   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt	   test_file  s    c         C   sG   | j  d ƒ j d d ƒ s" t ‚ | j  d ƒ j d d ƒ sC t ‚ d  S(   NR   Rk   i   i    (   R   R   R   (   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_not_file  s    "c         C   sË   | j  d ƒ j d d ƒ s! t ‚ | j  d ƒ j d d ƒ sB t ‚ | j  d ƒ j d d ƒ sc t ‚ | j  d ƒ j d d ƒ s„ t ‚ | j  d ƒ j d d ƒ s¥ t ‚ | j  d ƒ j d d ƒ sÇ t ‚ d  S(	   Ns   sampledir.nothereR   i    Rk   t   notfilei   R:   t	   notexists(   R   R   R   (   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_non_existent  s    !!!!!c         C   s1   | j  d ƒ } | j ƒ  t d ƒ k s- t ‚ d  S(   NR3   (   R   t   sizeRV   R   (   R   R   t   url(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt	   test_size!  s    c         C   s+   | j  d ƒ } | j ƒ  d k s' t ‚ d  S(   NR3   i    (   R   t   mtimeR   (   R   R   RŒ   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt
   test_mtime%  s    c         C   s   t  j j t d ƒ d  S(   Ns   path1.relto(42)(   RP   RQ   RR   t	   TypeError(   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_relto_wrong_type)  s    c         C   sU   | j  d ƒ } | j ƒ  } t | ƒ t k s3 t ‚ | j d d  ƒ d k sQ t ‚ d  S(   NR\   t   answeri*   (   R   t   loadt   typet   dictR   t   getRb   (   R   R   R   t   obj(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt	   test_load,  s    c         C   ss   g  } x0 | j  d „  ƒ D] } | j | j | ƒ ƒ q Wd | k sK t ‚ | j j d d g ƒ | k so t ‚ d  S(   Nc         S   s   |  j  d d ƒ S(   NRk   i   (   R   (   R'   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyRX   4  s    R   R   (   R^   R_   R>   R   R   R   (   R   R   R@   R`   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_visit_filesonly2  s
    c         C   s…   g  } x0 | j  d „  ƒ D] } | j | j | ƒ ƒ q Wd | k sK t ‚ | j j d d g ƒ | k so t ‚ d | k s t ‚ d  S(   Nc         S   s   |  j  d d ƒ S(   Nt   dotfilei    (   R   (   R'   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyRX   ;  s    R   R   s   .dotfile(   R^   R_   R>   R   R   R   (   R   R   R@   R`   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_visit_nodotfiles9  s    $c         C   s¶   g  } x0 | j  d t ƒ D] } | j | j | ƒ ƒ q Wxv t | ƒ D]X \ } } | j | k rF x6 t | t | ƒ ƒ D] } | j | | k sw t ‚ qw WPqF qF Wt	 j
 j d ƒ d  S(   Nt   bft   huh(   R^   R!   R_   R>   t	   enumerateR   t   rangeRV   R   RP   RQ   t   fail(   R   R   R@   R`   R   t   j(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_visit_breadthfirstA  s    c         C   s³   g  } x6 | j  d t d t ƒ D] } | j | j | ƒ ƒ q Wx- t | ƒ D] \ } } | j | k rL PqL qL W| |  t | |  ƒ k s t ‚ | | t | | ƒ k s¯ t ‚ d  S(   NRœ   R[   (   R^   R!   R_   R>   Rž   R   t   sortedR   (   R   R   R@   R`   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_visit_sortM  s     c         C   sW   d „  } | | ƒ s t  ‚ | | j d ƒ ƒ s8 t  ‚ | | j d ƒ ƒ sS t  ‚ d  S(   Nc         S   s   |  j  d d ƒ S(   NR   t   pickle(   R   (   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   chkX  s    R3   t
   somepickle(   R   R   (   R   R   R¦   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyRn   W  s    	c         C   s›   | j  d ƒ } | j  d ƒ } | j  d ƒ } | j | ƒ z@ | j ƒ  sO t ‚ | j ƒ  } | j ƒ  } | | k sy t ‚ Wd  | j ƒ  r– | j ƒ  n  Xd  S(   NRd   s   __init__.pyt   copied(   R   t   copyR   R   Rr   t   remove(   R   R   Rd   t   initpyR¨   t   s1t   s2(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_copy_file^  s    c         C   sÑ   | j  d ƒ } | j  d ƒ } z† | j | ƒ | j d d ƒ sF t ‚ | j  d ƒ j d d ƒ sg t ‚ | j  d ƒ j ƒ  } | j  d ƒ j ƒ  } | | k s£ t ‚ Wd  | j d d ƒ rÌ | j d d ƒ n  Xd  S(   NRd   t   newdirR   i   s   __init__.pyRk   t   rec(   R   R©   R   R   Rr   Rª   (   R   R   Rd   R¨   R¬   R­   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_copy_dirl  s    !c         C   sB   | j  d ƒ } | j ƒ  s! t ‚ | j ƒ  | j ƒ  s> t ‚ d  S(   Nt	   todeleted(   t   ensureR   R   Rª   (   R   R   t   d(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_remove_filez  s    
c         C   sW   | j  d d d ƒ } | j ƒ  s' t ‚ | j d ƒ } | j ƒ  | j ƒ  sS t ‚ d  S(   Nt   tot   bet   deleted(   R³   R   R   R   Rª   (   R   R   R´   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt$   test_remove_dir_recursive_by_default€  s
    
c         C   s=   | j  d d ƒ } | j d k s' t ‚ | j ƒ  s9 t ‚ d  S(   Nt   001t   002(   t
   ensure_dirR)   R   R   (   R   R   RK   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_ensure_dir‡  s    c         C   s°   | } t  j j t  j j | j d ƒ | j d ƒ } | j ƒ  | j d d ƒ sV t ‚ | j	 ƒ  | j d ƒ } | j d d ƒ s‡ t ‚ | j	 ƒ  | j d ƒ | k s¬ t ‚ d  S(   NR   t   mktest1R   i   t   mktest(
   RP   RQ   RR   RS   t   EEXISTt   mkdirR   R   R   Rª   (   R   R   t   tmpdirR   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_mkdir_and_removeŒ  s    


c         C   s©   | j  d ƒ } | j d ƒ } | j | ƒ z/ | j d d ƒ sF t ‚ | j ƒ  sY t ‚ Wd  | j ƒ  } t | d ƒ r… | j ƒ  n | j | ƒ | j ƒ  s¤ t ‚ Xd  S(   NR3   t   moved_samplefileRk   i   t   revert(   R   R0   t   moveR   R   t   hasattrRÅ   (   R   R   R   t   newpt   dp(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_move_file™  s    c         C   s„   | j  d ƒ } | j  d ƒ } | j | ƒ | j d d ƒ sC t ‚ | j  d ƒ j d d ƒ sd t ‚ | j  d ƒ j ƒ  s€ t ‚ d  S(   NR   t   moveddirR   i   R   Rk   (   R   RÆ   R   R   (   R   R   t   sourcet   dest(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_move_dir¨  s    !c         C   s   | j  ƒ  | j k s t ‚ d  S(   N(   t
   __fspath__t   strpathR   (   R   R   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt"   test_fspath_protocol_match_strpath°  s    c         C   sW   y d d l  m } Wn! t k
 r7 d d l m } n X| | ƒ | j k sS t ‚ d  S(   Niÿÿÿÿ(   t   fspath(   t   osRÒ   t   ImportErrort   py._path.commonRÐ   R   (   R   R   RÒ   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_fspath_func_match_strpath³  s
    s   sys.version_info < (3,6)c         C   s   | j  d ƒ } t | ƒ d  S(   Nt   opentestfile(   R   t   open(   R   R   t   f(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_fspath_openº  s    c         C   s5   d d l  m } | | ƒ | | j ƒ k s1 t ‚ d  S(   Niÿÿÿÿ(   t   fsencode(   RÓ   RÛ   RÐ   R   (   R   R   RÛ   (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   test_fspath_fsencode¿  s    (H   t   __name__t
   __module__R   R   R   R   R   R   R   R$   R(   R,   R-   R/   R1   R2   R6   R8   R9   R;   R=   RA   RI   RN   RP   RQ   t   markt   xfailRU   RW   RY   R]   Ra   Rc   Re   Rj   Rl   Rn   Rp   Rs   Ru   Rw   Ry   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   skipRÚ   RÜ   (    (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyR       s„   					
				
																																												
											c         C   su  |  j  d ƒ j ƒ  r d  S|  j d ƒ } | j d ƒ |  j d ƒ } | j d ƒ |  j d ƒ } | j d ƒ i d d 6d d	 6d
 d 6} |  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(   NR3   s   samplefile
t   execfiles   x=42s   execfile.pyi   i   RD   RC   i*   R’   R\   R   R   R   Rd   s   __init__.pys   a.pyi   s   from .b import stuff as result
s   from b import stuff as result
s   b.pys   stuff="got it"
s   c.pys7   import py;
import otherdir.a
value = otherdir.a.result
s   d.pys4   import py;
from otherdir import a
value2 = a.result
(   i   i   (   R   R   R³   t   writet   dumpt   syst   version_info(   t   pathR3   Râ   t
   execfilepyR´   R   Rd   t   module_at   module_bt   module_ct   module_d(    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   setuptestfsÄ  s4    (   RP   Rå   t   objectR    Rí   (    (    (    s9   /home/ronny/Projects/pytest-dev/py/testing/path/common.pyt   <module>   s   ÿ Á