
|W?M                 @   s  d  d l  Z d  d l j j Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 d  d l
 m Z m Z m Z d  d l m Z d  d l m Z d d   Z d d   Z Gd	 d
   d
 e  Z Gd d   d  Z d d   Z Gd d   d  Z d d   Z d d   Z Gd d   d  Z d S)    N)InfoSvnWCCommandXMLWCStatusparse_wcinfotime)svnwc)CommonSvnTestsc             C   sC  | j  d  } t j j d |  t j d k rN d t |  j d d  } t j j	 d |  } t j j
 | j  d   } | j |  | j } d } | | k } | sK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 }	 |	   } t |  }
 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 d t j   k s%t j t  r4t j t  n d d t j |	  d t j |  i } d- d | i } t t j |    d  }	 } }
 } } | j  d  } | j d  | j   | 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 |  rnt j |  n d d t j |  d  t j |  i } d0 d" | i } t t j |    d  } } } } } d }	 | |	 k } | sxt j d1 | f d2 | |	 f  d d$ t j   k s+t j |  r:t j |  n d$ d t j |	  i } d3 d | i } t t j |    d  } }	 | j   } d  }	 | |	 k } | s5t j d4 | f d5 | |	 f  d d$ t j   k st j |  rt j |  n d$ d t j |	  i } d6 d | i } t t j |    d  } }	 d  S)7Nrepozsvnadmin create %swin32/\z	file://%swcr   ==+%(py2)s
{%(py2)s = %(py0)s.rev
} == %(py5)spy0py5py2 assert %(py7)spy7e%(py7)s
{%(py7)s = %(py0)s(%(py5)s
{%(py5)s = %(py3)s
{%(py3)s = %(py1)s.listdir
}()
})
} == %(py10)spy1lenpy3py10assert %(py12)spy12Za_filez	test filez	some test   \%(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.info
}()
}.rev
} == %(py9)spy9py6ppy4assert %(py11)spy11%(py0)s == %(py3)srevassert %(py5)sis%(py0)s is %(py3)s)r   )r   r   )r   )r   r   )r   )r   r!   )r   )r#   r%   )r&   )r'   r%   )joinpyprocesscmdexecsysplatformstrreplacepathsvnurlr   checkoutr$   
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanationlistdirr   writeaddcommitinfo)path1tmpdirr   r   @py_assert1@py_assert4@py_assert3@py_format6@py_format8@py_assert2@py_assert6@py_assert9@py_assert8@py_format11@py_format13r   r$   @py_assert5@py_assert7@py_format10@py_format12@py_format4 rR   =/home/ronny/Projects/pytest-dev/py/testing/path/test_svnwc.pytest_make_repo   sl    	    y   	 	        
	 	 	          j   
   j   rT   c             C   s   |  j  d  \ } } } | S)Nrepowc1)getfuncargvalue)requestr   repourlr   rR   rR   rS   pytest_funcarg__path1   s    rY   c               @   s  e  Z d  Z d d   Z d d   Z d d   Z d d   Z d	 d
   Z d d   Z e	 j
 j d d  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 d1 d2   Z d3 d4   Z d5 d6   Z d7 d8   Z  d9 d:   Z! d; d<   Z" d= d>   Z# d? S)@TestWCSvnCommandPathc             C   sE   d d   } | j  d  } | | j  d   | | j  d   d  S)Nc             S   s  |  j    } | j } | } | s d d d d t j   k sM t j |  r\ t j |  n d d t j |  i } t t j |    d  } } | j	 } | } | sd d 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 d t j   k s]t j |  rlt j |  n d d t j |  i } t t j |    d  } } | j } | } | s"d d 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 d t j   k smt j |  r|t j |  n d d t j |  i } t t j |    d  } } d  S)
Nr   z0assert not %(py2)s
{%(py2)s = %(py0)s.modified
}r   sr   z5assert not %(py2)s
{%(py2)s = %(py0)s.prop_modified
}z-assert not %(py2)s
{%(py2)s = %(py0)s.added
}z/assert not %(py2)s
{%(py2)s = %(py0)s.deleted
}z0assert not %(py2)s
{%(py2)s = %(py0)s.replaced
})statusmodifiedr5   r6   r3   r7   r8   r9   r:   prop_modifiedaddeddeletedreplaced)r   r[   rB   rD   rQ   rR   rR   rS   assert_nochange!   s>    	   S  
	   S  
	   S  
	   S  
	   S  zKTestWCSvnCommandPath.test_status_attributes_simple.<locals>.assert_nochange	sampledir
samplefile)r(   )selfr@   rb   ZdpathrR   rR   rS   test_status_attributes_simple    s    z2TestWCSvnCommandPath.test_status_attributes_simplec             C   s]  | j  d  } | j d  | j   z%| j   } | j } | s d d d d t j   k so t j |  r~ t j	 |  n d d t j	 |  i } t
 t j |    d  } | j } | } | s0d d 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 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 d t j   k st j |  rt j	 |  n d d t j	 |  i } t
 t j |    d  } } Wd  | j   Xd  S)Nnewfilehellor   z)assert %(py2)s
{%(py2)s = %(py0)s.added
}r   r[   r   z0assert not %(py2)s
{%(py2)s = %(py0)s.modified
}z5assert not %(py2)s
{%(py2)s = %(py0)s.prop_modified
}z0assert not %(py2)s
{%(py2)s = %(py0)s.replaced
})r(   r<   r=   r\   r_   r5   r6   r3   r7   r8   r9   r:   r]   r^   ra   revert)re   r@   nfr[   rB   @py_format3rD   rQ   rR   rR   rS   test_status_added-   s:    
	  S  	   S  
	   S  
	   S  z&TestWCSvnCommandPath.test_status_addedc             C   s]  | j  d  } z<| j | j   d  | j   } | j } | } | s d d d d t j   k sv t j |  r t j	 |  n d d t j	 |  i } t
 t j |    d  } } | j } | s4d d 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 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 d t j   k st j |  rt j	 |  n d d t j	 |  i } t
 t j |    d  } } Wd  | j   Xd  S)Nrd   Zchanger   z-assert not %(py2)s
{%(py2)s = %(py0)s.added
}r   r[   r   z,assert %(py2)s
{%(py2)s = %(py0)s.modified
}z5assert not %(py2)s
{%(py2)s = %(py0)s.prop_modified
}z0assert not %(py2)s
{%(py2)s = %(py0)s.replaced
})r(   r<   readr\   r_   r5   r6   r3   r7   r8   r9   r:   r]   r^   ra   ri   )re   r@   rj   r[   rB   rD   rQ   rk   rR   rR   rS   test_status_change:   s8    	   S  
	  S  	   S  
	   S  z'TestWCSvnCommandPath.test_status_changec             C   s?  | j  d  } z| j d  } | j  d  } | j d  | j   | j d 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 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  } } } Wd  | j d d  | j j d d  Xd  S)Nrc   t2t1testrecr   c             S   s   g  |  ] } | j   q SrR   )basename).0itemrR   rR   rS   
<listcomp>P   s   	 zFTestWCSvnCommandPath.test_status_added_ondirectory.<locals>.<listcomp>in0%(py2)s
{%(py2)s = %(py0)s.basename
} in %(py5)sr   r   r   r   assert %(py7)sr   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   ru   rR   rR   rS   rv   Q   s   	 )rw   )rx   ry   )rw   )rx   ry   )r(   mkdirr<   r=   r\   rs   r_   r3   r4   r5   r6   r7   r8   r9   r:   ri   	localpathremove)re   r@   rc   ro   rp   r[   rB   rC   rD   rE   rF   rR   rR   rS   test_status_added_ondirectoryF   s2    
	    y   	    y   z2TestWCSvnCommandPath.test_status_added_ondirectoryc       	      C   s  | j  d  } z | j d  | j   } | 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  } } } Wd  | j j   Xd  S)NZun1rq   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   ru   rR   rR   rS   rv   ]   s   	 z<TestWCSvnCommandPath.test_status_unknown.<locals>.<listcomp>rw   0%(py2)s
{%(py2)s = %(py0)s.basename
} in %(py5)sr   rp   r   r   r   assert %(py7)sr   )rw   )r~   r   )r(   r<   r\   rs   unknownr3   r4   r5   r6   r7   r8   r9   r:   r{   r|   )	re   r@   rp   r[   rB   rC   rD   rE   rF   rR   rR   rS   test_status_unknownV   s    	    y   z(TestWCSvnCommandPath.test_status_unknownc             C   s  | } | j  d d  } | j } d } | |  } | 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 t j |  d t j |  d t j |  i }
 d d |
 i } t
 t j |    d  } } } } }	 } | j } d } | |  } | 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 t j |  d t j |  d t j |  i }
 d d |
 i } t
 t j |    d  } } } } }	 } | j } d } | |  } | 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	 |  r5t j |  n d d t j |  d t j |  d t j |  i }
 d d |
 i } t
 t j |    d  } } } } }	 } d  S)Nrr   r   rd   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   ru   rR   rR   rS   rv   f   s   	 z>TestWCSvnCommandPath.test_status_unchanged.<locals>.<listcomp>rw   i%(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.basename
} in %(py11)sr"   r   r   rr   r    py8r   assert %(py13)spy13rc   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   ru   rR   rR   rS   rv   h   s   	 zsampledir/otherfilec             S   s   g  |  ] } | j   q SrR   )rs   )rt   ru   rR   rR   rS   rv   j   s   	 )rw   )r   r   )rw   )r   r   )rw   )r   r   )r\   r(   rs   	unchangedr3   r4   r8   r5   r6   r7   r9   r:   )re   r@   r   r[   rB   rD   rM   rN   @py_assert10rI   rP   @py_format14rR   rR   rS   test_status_unchangeda   sF    	   	       	   	       	   	       z*TestWCSvnCommandPath.test_status_unchangedreasonz'svn-1.7 has buggy 'status --xml' outputc             C   s  | } zv| j  d d  | j d d d d  } t j j j | j    | j } d } | |  } | j } d d   | j D } | | k }	 |	 sa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 t	 j |  d t	 j |  d t	 j |  i }
 d d |
 i } t t	 j |    d  } } } } }	 } Wd  | j    Xd  S)Nr$   r   updatesrr   anotherfilec             S   s   g  |  ] } | j   q SrR   )rs   )rt   ru   rR   rR   rS   rv   v   s   	 z;TestWCSvnCommandPath.test_status_update.<locals>.<listcomp>rw   i%(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.basename
} in %(py11)sr"   r   r   r   r   r    r   r   assert %(py13)sr   )rw   )r   r   )updater\   r)   stdpprintallpathr(   rs   update_availabler3   r4   r8   r5   r6   r7   r9   r:   )re   r@   r   r[   rB   rD   rM   rN   r   rI   rP   r   rR   rR   rS   test_status_updatem   s"    	   	       z'TestWCSvnCommandPath.test_status_updatec       	      C   s.  | j  d  } | j   | j d d  z | j   } | 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  } } } Wd  | j d d  Xd  S)Nrd   dirr   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   ru   rR   rR   rS   rv      s   	 z=TestWCSvnCommandPath.test_status_replaced.<locals>.<listcomp>rw   0%(py2)s
{%(py2)s = %(py0)s.basename
} in %(py5)sr   r   r   r   r   assert %(py7)sr   rr   r   )rw   )r   r   )r(   r|   ensurer\   rs   ra   r3   r4   r5   r6   r7   r8   r9   r:   ri   )	re   r@   r   r[   rB   rC   rD   rE   rF   rR   rR   rS   test_status_replaced|   s    
	    y   z)TestWCSvnCommandPath.test_status_replacedc       
      C   s  z| j  d  } t j j |  j  d  } | j d d  | j   } d d   | j D } d g } | | k } | s t j d | f d | | f  d	 t j	 |  d
 t j	 |  i } d d | i }	 t
 t j |	    d  } } } d d   | j D } g  } | | k } | st j d | f d | | f  d	 t j	 |  d
 t j	 |  i } d d | i }	 t
 t j |	    d  } } } | j d d  | j   } d d   | j D } g  } | | k } | sFt j d | f d | | f  d	 t j	 |  d
 t j	 |  i } d d | i }	 t
 t j |	    d  } } } d d   | j D } d g } | | k } | st j d | f d | | f  d	 t j	 |  d
 t j	 |  i } d d | i }	 t
 t j |	    d  } } } Wd  | j d d  Xd  S) Nrc   ZignoredfilefileTc             S   s   g  |  ] } | j   q SrR   )rs   )rt   xrR   rR   rS   rv      s   	 z<TestWCSvnCommandPath.test_status_ignored.<locals>.<listcomp>r   %(py1)s == %(py4)sr   r    r   assert %(py6)sr   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   r   rR   rR   rS   rv      s   	 z
svn:ignorec             S   s   g  |  ] } | j   q SrR   )rs   )rt   r   rR   rR   rS   rv      s   	 c             S   s   g  |  ] } | j   q SrR   )rs   )rt   r   rR   rR   rS   rv      s   	 rr   r   )r   )r   r   )r   )r   r   )r   )r   r   )r   )r   r   )r(   r)   r0   localr   r\   r   r3   r4   r8   r9   r:   ignoredpropsetri   )
re   r@   dr   r[   @py_assert0rD   rG   @py_format5@py_format7rR   rR   rS   test_status_ignored   sP     	   C       C       C    	   C   z(TestWCSvnCommandPath.test_status_ignoredc             C   sN  | } t  j j | j d   } | j | j  | j d d d } | j d  | j d  | j	   | 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 |  d t j |  d t j |
  d t j |	  i } t t j |    d  } } } }	 }
 | j d  | j d  | j d  j d  | j	 d d  | j   } d d   | j D } d g } | | k } | s<t j d | f d | | f  d t j |  d t j |  i } d d	 | i } t t j |    d  } } } d  S)NZconflict_copyZconflictsamplefiler   r   foozadded conflictsamplefiler   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   wccopyr   r    r   r   barzwrote some dataZbazinteractiveFc             S   s   g  |  ] } | j   q SrR   )rs   )rt   r   rR   rR   rS   rv      s   	 z=TestWCSvnCommandPath.test_status_conflict.<locals>.<listcomp>r   %(py1)s == %(py4)sr   assert %(py6)s)r   )r   r   )r)   r0   r   r(   r2   urlr   r<   r>   r   checkr3   r8   r5   r6   r7   r9   r:   r\   conflictr4   )re   r@   rA   r   r   r   rB   rD   rM   rN   rI   rK   r[   r   rG   r   r   rR   rR   rS   test_status_conflict   s:    
	   	 	     	   C   z)TestWCSvnCommandPath.test_status_conflictc             C   s"  | \ } } } | j  d d d } z| j   | j d d | j f  | j   | j   } d d   | j D } d g }	 | |	 k }
 |
 s t j d |
 f d | |	 f  d t j |  d t j |	  i } d d | i } t	 t j
 |    d  } }
 }	 d } d d   | j D }	 | |	 k }
 |
 st j d |
 f d | |	 f  d t j |  d t j |	  i } d d | i } t	 t j
 |    d  } }
 }	 | j d d  } d d   | j D } d g }	 | |	 k }
 |
 sWt j d |
 f d | |	 f  d t j |  d t j |	  i } d  d | i } t	 t j
 |    d  } }
 }	 d } d d   | j D }	 | |	 k }
 |
 st j d! |
 f d" | |	 f  d t j |  d t j |	  i } d# d | i } t	 t j
 |    d  } }
 }	 Wd  | j d d  Xd  S)$Nrc   r   r   zsvn:externalsz
otherwc %sc             S   s   g  |  ] } | j   q SrR   )rs   )rt   r   rR   rR   rS   rv      s   	 z=TestWCSvnCommandPath.test_status_external.<locals>.<listcomp>otherwcr   %(py1)s == %(py4)sr   r    r   assert %(py6)sr   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   r   rR   rR   rS   rv      s   	 not in%(py1)s not in %(py4)srr   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   r   rR   rR   rS   rv      s   	 c             S   s   g  |  ] } | j   q SrR   )rs   )rt   r   rR   rR   rS   rv      s   	 rw   %(py1)s in %(py4)s)r   )r   r   )r   )r   r   )r   )r   r   )rw   )r   r   )r   r   r   r   r\   externalr3   r4   r8   r9   r:   r   ri   )re   r@   Zrepowc2Z	otherrepoZotherrepourlr   r   r[   r   rD   rG   r   r   rR   rR   rS   test_status_external   sR    

 	   C       C    	   C       C   z)TestWCSvnCommandPath.test_status_externalc             C   s+  | j  d d d } | j   | j  d d  | j   | j  d d d | j   | j   } d } d d   | j D } | | k } | s t j d | f d | | f  d
 t j |  d t j |  i } d d | i } t t j	 |    d  } } } | j
 }	 |	 } | sd d 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   } d } | j } | | k } | srt j d | f d  | | f  d t j |  d
 t j |  d d t j   k s4t j |  rCt j |  n d i } d! d | i } t t j	 |    d  } } } d d   | j
 D } d g } | | k } | st j d" | f d# | | f  d
 t j |  d t j |  i } d$ d | i } t t j	 |    d  } } } d  S)%Nrc   r   r   Z
deletefiler   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   r   rR   rR   rS   rv      s   	 z<TestWCSvnCommandPath.test_status_deleted.<locals>.<listcomp>rw   %(py1)s in %(py4)sr   r    r   assert %(py6)sr   z/assert not %(py2)s
{%(py2)s = %(py0)s.deleted
}r   r[   r   r   5%(py1)s not in %(py5)s
{%(py5)s = %(py3)s.unchanged
}r   r   assert %(py7)sr   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   r   rR   rR   rS   rv      s   	 r   %(py1)s == %(py4)s)rw   )r   r   )r   )r   r   )r   )r   r   )r   r|   r>   r\   r   r3   r4   r8   r9   r:   r`   r5   r6   r7   r(   )re   r@   r   r[   r   rD   rG   r   r   rB   rQ   r   rC   rE   rF   rR   rR   rS   test_status_deleted   sP    


    C   	   S  

 	   y    	   C   z(TestWCSvnCommandPath.test_status_deletedc             C   s   d } t  j | |  d  S)Nz        <entry path="/tmp/pytest-23/wc">
        <wc-status item="normal" props="none" revision="0">
        <commit revision="0">
        <date>2008-08-19T16:50:53.400198Z</date>
        </commit>
        </wc-status>
        </entry>
        )r   
fromstring)re   r@   xmlrR   rR   rS   test_status_noauthor   s    
z)TestWCSvnCommandPath.test_status_noauthorc       
      C   s>  d } t  j | |  } | j } t |  } d } | | 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 t  r t j	 t  n d d	 t j	 |  d
 t j	 |  d t j	 |  i } d d | i }	 t
 t j |	    d  } } } } d  S)Nz<entry path="/home/jean/zope/venv/projectdb/parts/development-products/DataGridField">
<wc-status item="incomplete" props="none" revision="784">
</wc-status>
</entry>r   r   P%(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.incomplete
})
} == %(py8)sr   str   r   r   r   r   r   assert %(py10)sr   )r   )r   r   )r   r   
incompleter   r3   r4   r5   r6   r7   r8   r9   r:   )
re   r@   r   r   rG   rC   rN   rH   @py_format9rK   rR   rR   rS   test_status_wrong_xml   s    	        z*TestWCSvnCommandPath.test_status_wrong_xmlc             C   s0  | d } | j  d d  } | j } d } | |  } 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 t j |  d t j |  i }
 d d |
 i } t t j	 |    d  } } } }	 } } d  S)Nr   r$      rh   r   !=K%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.find
}(%(py4)s)
} != -%(py9)sr   r   r   outr   r    r   assert %(py12)sr   )r   )r   r   )
difffindr3   r4   r8   r5   r6   r7   r9   r:   )re   r@   r   r   rB   rD   rM   rJ   r   rN   rK   rL   rR   rR   rS   	test_diff   s    
	          zTestWCSvnCommandPath.test_diffc             C   s  | j  d  } | j   } d d   | D } t |  } t |  } | | k } | sq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 t  r t j	 t  n d	 d
 d t j   k st j t  rt j	 t  n d d t j	 |  d t j	 |  d t j	 |  i } d# d | i }	 t
 t j |	    d  } } } } x t | j   d d   | D  D] \ }
 } |
 | k } | sz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 |  rKt j	 |  n d i } d& d | i } t
 t j |    d  } qWd d   | D } d g } t |  } | | } | | 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 sOt j t  r^t j	 t  n d	 d t j	 |  d t j	 |  i } d) d | i }	 t
 t j |	    d  } } } } } | j  d  } | j   } d d   | D } t |  } t |  } | | k } | s2t j d* | f d+ | | f  d d t j   k s[t j |  rjt j	 |  n d d d	 t j   k st j t  rt j	 t  n d	 d
 d t j   k st j t  rt j	 t  n d d t j	 |  d t j	 |  d t j	 |  i } d, d | i }	 t
 t j |	    d  } } } } x t | j   d 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 d t j   k st j |  rt j	 |  n d i } d/ d | i } t
 t j |    d  } qgWd  d   | D } d g } t |  } | | } | | k } | slt j d0 | f d1 | | 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 t  rt j	 t  n d	 d t j	 |  d t j	 |  i } d2 d | i }	 t
 t j |	    d  } } } } } d  S)3Nsamplepicklec             S   s   g  |  ] } | d   q S)r   rR   )rt   lrR   rR   rS   rv      s   	 z3TestWCSvnCommandPath.test_blame.<locals>.<listcomp>r   N%(py4)s
{%(py4)s = %(py0)s(%(py2)s)
} == %(py9)s
{%(py9)s = %(py6)s(%(py7)s)
}r   linesr   r   r   sumr   r    r   r   assert %(py11)sr"   c             S   s   g  |  ] } | d   q S)r   rR   )rt   r   rR   rR   rS   rv      s   	 %(py0)s == %(py2)sl1l2assert %(py4)sc             S   s   g  |  ] } | d   q S)r   rR   )rt   r   rR   rR   rS   rv      s   	 hpk<%(py1)s == (%(py4)s * %(py8)s
{%(py8)s = %(py5)s(%(py6)s)
})r   r   r   rd   c             S   s   g  |  ] } | d   q S)r   rR   )rt   r   rR   rR   rS   rv      s   	 c             S   s   g  |  ] } | d   q S)r   rR   )rt   r   rR   rR   rS   rv      s   	 c             S   s   g  |  ] } | d   q S)r   rR   )rt   r   rR   rR   rS   rv      s   	 )r   )r   r   )r   )r   r   )r   )r   r   )r   )r   r   )r   )r   r   )r   )r   r   )r(   blamer   r   r3   r4   r5   r6   r7   r8   r9   r:   zip	readlines)re   r@   r   r   rB   rD   rJ   rM   rO   rP   r   r   rk   r   r   rN   rI   rG   rR   rR   rS   
test_blame   sp            /     
 	  
              /     
 	  
      zTestWCSvnCommandPath.test_blamec             C   s   t  | j  } | j | d d } | | k } | s t j d | f d | | f  d d t j   k sx 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absr   r   %(py0)s == %(py2)sr   r@   r   nr   assert %(py4)sr    )r   )r   r   )r.   r{   r(   r3   r4   r5   r6   r7   r8   r9   r:   )re   r@   r[   r   rB   rk   r   rR   rR   rS   test_join_abs   s         z"TestWCSvnCommandPath.test_join_absc             C   s  | j  } d } d } | | d | } | j  } d } | |  } | | k }	 |	 r~t j d f |	 f d f | | f  d t j |  d d t j   k p t j |  r t j |  n d d	 t j |  d
 t j |  d t j |  d t j |  d t j |  d d t j   k p*t j |  r<t j |  n d d t j |  i	 }
 d d d |
 i } t t j |    d  } } } } }	 } } } d  S)Nrd   r   r   r   z%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s, abs=%(py6)s)
} == %(py16)s
{%(py16)s = %(py12)s
{%(py12)s = %(py10)s.join
}(%(py14)s)
}r   r   r@   py16r   r    py14r   r   r   r   zassert %(py18)spy18)	r(   r3   r4   r8   r5   r6   r7   r9   r:   )re   r@   rB   rD   rM   rN   @py_assert11@py_assert13@py_assert15rI   @py_format17@py_format19rR   rR   rS   test_join_abs2   s    	    	         z#TestWCSvnCommandPath.test_join_abs2c             C   s  t  |  } | j } t  |  } | | k } | rt j d f | f d f | | f  d d t j   k py 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 t   r t j t   n d d d t j   k pt j t   r-t j t   n d d	 t j |  d
 t j |  d t j |  i } d d d | i } t t j	 |    d  } } } } d  S)Nr   zo%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py10)s
{%(py10)s = %(py5)s(%(py8)s
{%(py8)s = %(py6)s.localpath
})
}r   r@   r   r   r.   r   r   r   r   r   zassert %(py12)sr   )
r.   r{   r3   r4   r5   r6   r7   r8   r9   r:   )re   r@   rG   rN   rI   rC   rK   rL   rR   rR   rS   test_str_gives_localpath   s     	     1   z-TestWCSvnCommandPath.test_str_gives_localpathc             C   s  | j  } d } | d |  } | s d d d t j |  d d t j   k s^ t j |  rm t j |  n d d t j |  d	 t j |  i } t t j |    d  } } } | j } d
 } | |  } | j  } d } | d |  } | sd d d t j |  d d t j   k s1t j |  r@t j |  n d d t j |  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 d t j   k sDt j |  rSt j |  n d d t j |  d	 t j |  d t j |  d t j |  d t j |  i } t t j |    d  } } } } } } }
 | j d  j	 } z| j
 d  | j } d } | |  } | j  } d } | d |  } | sd d d t j |  d d t j   k svt j |  rt j |  n d d t j |  d	 t j |  d t j |  d t j |  d t j |  i }	 t t j |	    d  } } } } } } Wd  | j   Xd  S)Nr   	versionedr   zQassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(versioned=%(py4)s)
}r   r   r@   r   r    rd   zassert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(versioned=%(py10)s)
}r   r   r   notexistingzassert not %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(versioned=%(py10)s)
}rh   r   )r   r3   r8   r5   r6   r7   r9   r:   r(   r{   r<   r|   )re   r@   rB   rD   rM   r   rN   rI   r   rL   r   r   r   rR   rR   rS   test_versioned   sT    	    q  	   	      	   	       	   	      z#TestWCSvnCommandPath.test_versionedc       
   
   C   s  | j  } d } | d |  } | s d d d t j |  d d t j   k s^ t j |  rm t j |  n d d t j |  d	 t j |  i } t t j |    d  } } } | j j	 d
  } d d   | j
 d d    D } | | 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 svt j |  rt j |  n d i } d d	 | i }	 t t j |	    d  } d  S)Nr   r   r   zQassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(versioned=%(py4)s)
}r   r   r@   r   r    Znot_a_versioned_filec             S   s   g  |  ] } | j   q SrR   )r{   )rt   r   rR   rR   rS   rv     s   	z?TestWCSvnCommandPath.test_listdir_versioned.<locals>.<listcomp>c             S   s   |  j  d d  S)Nr   T)r   )r   rR   rR   rS   <lambda>  s    z=TestWCSvnCommandPath.test_listdir_versioned.<locals>.<lambda>r   %(py0)s not in %(py2)sr   r   assert %(py4)s)r   )r   r   )r   r3   r8   r5   r6   r7   r9   r:   r{   r   r;   r4   )
re   r@   rB   rD   rM   r   r   r   rk   r   rR   rR   rS   test_listdir_versioned  s     	    q  	     z+TestWCSvnCommandPath.test_listdir_versionedc          
   C   sM  | j  } d } | d |  } | s d d d t j |  d d t j   k s^ t j |  rm t j |  n d d t j |  d	 t j |  i } t t j |    d  } } } | j d
  } t	 j
 j |  } | j   | j  } |   } | srd d d d t j   k s&t j |  r5t j |  n d d t j |  d	 t j |  i } t t j |    d  } } | j  } d } | d |  } | }	 |	 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 |  i }
 t t j |
    d  } } } }	 | j   d  S)Nr   r   r   zQassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(versioned=%(py4)s)
}r   r   r@   r   r    znonversioned/somefilez@assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}somefileTzUassert not %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(versioned=%(py4)s)
})r   r3   r8   r5   r6   r7   r9   r:   r(   r)   r0   r   r   r|   )re   r@   rB   rD   rM   r   r   Znonwcr   rN   rF   rR   rR   rS   test_nonversioned_remove
  s2    	    q  
	 	  b  
	     q  z-TestWCSvnCommandPath.test_nonversioned_removec             C   s  z| j  d d  | j } d } | |  } 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	 t j |  d
 t j |  i } d d | i } t t j	 |    d  } } } } } | j
 } d d   | 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	 t j |  i }
 d  d |
 i } t t j	 |    d  } } }	 d } | j }	 |	   } | | 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 i } d# d | i } t t j	 |    d  } } }	 } | j   d } d } | | k } | stt j d$ | f d% | | f  d t j |  d
 t j |  i } d& d | i } t t j	 |    d  } } } Wd  | j d  Xd  S)'Ngagathisr   M%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.propget
}(%(py4)s)
} == %(py9)sr   r   r   r@   r   r    r   assert %(py11)sr"   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   ru   rR   rR   rS   rv     s   	 z8TestWCSvnCommandPath.test_properties.<locals>.<listcomp>rw   0%(py2)s
{%(py2)s = %(py0)s.basename
} in %(py5)sr   assert %(py7)sr   G%(py1)s in %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.proplist
}()
}r   r   assert %(py9)s%(py1)s == %(py4)sassert %(py6)s)r   )r   r   )rw   )r   r   )rw   )r   r   )r   )r   r  )r   propgetr3   r4   r8   r5   r6   r7   r9   r:   rs   r\   r^   proplistpropdel)re   r@   rB   rD   rM   rJ   rN   rO   rP   rC   rE   rF   r   rH   rG   r   r   rR   rR   rS   test_properties  sL    	         	    y    	 	          C   z$TestWCSvnCommandPath.test_propertiesc             C   sK  | j  d  } | j d d  z| j d d  } d } | | } | 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 t j	 |  d t j	 |  i }	 d d |	 i }
 t
 t j |
    d  } } } } } Wd  | j d  Xd  S)Nrd   Zguguthatrr   r   c             S   s   g  |  ] } | j   q SrR   )rs   )rt   ru   rR   rR   rS   rv   (  s   	 z@TestWCSvnCommandPath.test_proplist_recursive.<locals>.<listcomp>rw   <%(py5)s
{%(py5)s = (%(py0)s / %(py2)s).basename
} in %(py8)sr   r@   r   r   r   r   assert %(py10)sr   )rw   )r  r  )r(   r   r  rs   r3   r4   r5   r6   r7   r8   r9   r:   r  )re   r@   r[   r   rB   rD   rC   rN   rH   r   rK   rR   rR   rS   test_proplist_recursive!  s     
 	       z,TestWCSvnCommandPath.test_proplist_recursivec             C   s  d } z | 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 d t j   k s t j |  r t j |  n d i } d d | i } t t j	 |    d  } Wd  | j
 d  Xd  S)Nzq
        vadm:posix : root root 0100755
        Properties on 'chroot/dns/var/bind/db.net.xots':
                r   r   %(py0)s == %(py2)sr   	backvaluer   valuer   assert %(py4)sr    )r   )r
  r  )r   r  r3   r4   r5   r6   r7   r8   r9   r:   r  )re   r@   r  r  rB   rk   r   rR   rR   rS   test_long_properties-  s         
z)TestWCSvnCommandPath.test_long_propertiesc             C   s  | j  d d d  } z| j } d } d } | 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 |  i } t t j |    d  } } } } | j	 d  | j    | 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  } } } } Wd  | j d  j d d  Xd  S)Nabcr   existsr   r   zaassert %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.check
}(exists=%(py4)s, versioned=%(py6)s)
}r   r   r   newpathr   r    rh   r   C%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py7)sr   assert %(py9)sr   force)r   )r  r  )r   r   r3   r8   r5   r6   r7   r9   r:   r<   rm   r4   r(   r|   )re   r@   r  rB   rD   rM   rN   r   rH   rF   rO   rR   rR   rS   test_ensure;  s,    	       
	 	       z TestWCSvnCommandPath.test_ensurec             C   sy  | j  j d  } | j  j d  } z3| j } d } | |  } | j } d } | d |  }	 |	 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 |  d t j |  i }
 t
 t j |
    d  } } } } } }	 | j } d } | |  } | j } d } | d |  }	 |	 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 |  d t j |  i }
 t
 t j |
    d  } } } } } }	 | j } d } | |  } | j } d } | d |  }	 |	 } | s8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 |  d t j |  i } t
 t j |    d  } } } } } }	 } Wd  | j d d  | j   Xd  S)NZwhateverZtestcreatedfiler   r   r   zassert %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(versioned=%(py10)s)
}r   r   r@   r   r    r   r   r   r   zassert not %(py12)s
{%(py12)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}(versioned=%(py10)s)
}rr   )r{   rz   r   r(   r   r3   r8   r5   r6   r7   r9   r:   r|   )re   r@   r   frB   rD   rM   rN   rI   r   rL   r   r   rR   rR   rS   test_not_versionedE  sH    	   	      	   	      	   	       "z'TestWCSvnCommandPath.test_not_versionedc             C   sy  | } | j  d  } | j d d  t j j t d  | j d  | j d  | j } d } | d |  } | 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
 |  i } t t	 j |    d  } } } | j   zv| j   j } t |  }	 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 t  rt	 j
 t  n d d t	 j
 |	  i } d( d | i } t t	 j |    d  }	 }
 } | d } | 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 t	 j
 |  d t	 j
 |	  i } d+ d | i } t t	 j |    d  } }	 }
 } | d } | j }	 |	   }
 |
 j } | j } |   } | j } | | k } | sTt	 j d, | f d- | | f  d t	 j
 |  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
 |  d t	 j
 |	  d  t	 j
 |  i } d. d" | i } t t	 j |    d  } }	 }
 } } } } } t j j t d  Wd  | j   X| j   j } g  }	 | |	 k } | sNt	 j d/ | f d0 | |	 f  d d t j   k st	 j |  rt	 j
 |  n d d t	 j
 |	  i } d1 d | i } t t	 j |    d  } }	 t j j t d%  | j   d  S)2Nr   r   Tzsomefile.lock()r   rq   r   r   zQassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.check
}(versioned=%(py4)s)
}r   r   r   r    r   r   0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sr   lockedr   r   assert %(py8)sr   r   N%(py3)s
{%(py3)s = %(py1)s.basename
} == %(py7)s
{%(py7)s = %(py5)s.basename
}r   r   assert %(py9)sr   %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s
{%(py3)s = %(py1)s.dirpath
}()
}.basename
} == %(py15)s
{%(py15)s = %(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py9)s.dirpath
}()
}.basename
}r"   r   py15assert %(py17)spy17%(py0)s == %(py3)sassert %(py5)szsomefile,unlock())r   )r  r  )r   )r  r  )r   )r  r!  )r   )r#  r$  )r(   r   r)   rq   raises	Exceptionr<   r>   r   r3   r8   r5   r6   r7   r9   r:   lockr\   r  r   r4   rs   dirpathunlockr|   )re   r@   rootr   rB   rD   rM   r   r  rG   rC   r   r   rH   rF   rO   r   @py_assert12@py_assert14rJ   @py_format16@py_format18rQ   rE   rR   rR   rS   test_lock_unlockP  st    	    q  
       
 	 	      
 	 	 	 	 	 	      "   j   
z%TestWCSvnCommandPath.test_lock_unlockc       
      C   s@  | j  d  } | j d  | j d d  | j   } | j } t |  } d } | | k } | sH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
 t  r t j t  n d d t j |  d t j |  d t j |  i } d d | i }	 t t j |	    d  } } } } | j } t |  } d } | | 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
 t  rt j t  n d d t j |  d t j |  d t j |  i } d d | i }	 t t j |	    d  } } } } | j d d d | j   } | j } t |  } d } | | 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
 t  rOt j t  n d d t j |  d t j |  d t j |  i } d d | i }	 t t j |	    d  } } } } | j } t |  } d } | | 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 sbt j
 t  rqt j t  n d d t j |  d t j |  d t j |  i } d" d | i }	 t t j |	    d  } } } } | j d  | j   } | j } t |  } d } | | k } | st j d# | f d$ | | f  d d	 t j	   k sgt j
 |  rvt j |  n d	 d
 d t j	   k st j
 t  rt j t  n d d t j |  d t j |  d t j |  i } d% d | i }	 t t j |	    d  } } } } | j } t |  } d } | | 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
 t  rt j t  n d d t j |  d t j |  d t j |  i } d( d | i }	 t t j |	    d  } } } } d  S))Nrc   Z	subsubdirr   r   r   r   S%(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.prop_modified
})
} == %(py8)sr   r\   r   r   r   r   r   r   assert %(py10)sr   K%(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.added
})
} == %(py8)sznon-recursive commitrr   r   zrecursive commit)r   )r0  r1  )r   )r2  r1  )r   )r0  r1  )r   )r2  r1  )r   )r0  r1  )r   )r2  r1  )r(   rz   r   r\   r^   r   r3   r4   r5   r6   r7   r8   r9   r:   r_   r>   )
re   r@   Zsomedirr\   rG   rC   rN   rH   r   rK   rR   rR   rS   test_commit_nonrecursivei  s|    	        	        	        	        	        	        z-TestWCSvnCommandPath.test_commit_nonrecursivec          
   C   s  | j  d  j d d  } | j d  | j d  } t |  } | t k } | sPt j d | f d | t f  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 |  d d t j	   k st j
 t  r!t j t  n d i } d d | i } t t j |    d  } } | j  d  j d d  } | j d  | j d  }	 t |	  } | t k } | st j d | f d | t f  d d t j	   k st j
 |	  r t j |	  n d d
 d t j	   k s't j
 t  r6t j t  n d d t j |  d d t j	   k slt j
 t  r{t j t  n d 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
 |	  r't j |	  n d d d	 t j	   k sNt j
 |  r]t j |  n d	 d t j |
  i } d! d | i } t t j |    d  } }
 } d  S)"Nztest.txtr   Trq   Ztestingr   0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py5)sr   r$   r   typer   r   intr   assert %(py7)sr   zanother.txtztesting morerev2r   %(py0)s == (%(py2)s + %(py4)s)r   r    )r   )r4  r7  )r   )r4  r7  )r   )r9  r7  )r(   r   r<   r>   r5  r6  r3   r4   r5   r6   r7   r8   r9   r:   )re   r@   testfiler$   rG   rC   rE   rF   r   r8  rD   rM   rB   rR   rR   rS   test_commit_return_value{  s8          
      
 
      z-TestWCSvnCommandPath.test_commit_return_valueN)$__name__
__module____qualname__rf   rl   rn   r}   r   r   pytestmarkxfailr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r	  r  r  r  r/  r3  r;  rR   rR   rR   rS   rZ      s<   !
	
rZ   c               @   s   e  Z d  Z d Z d S)XTestWCSvnCommandPathSpecialz=http://codespeak.net/svn/py.path/trunk/dist/py.path/test/dataN)r<  r=  r>  ZrooturlrR   rR   rR   rS   rB    s   rB  c           
   C   s  d }  t  |   } d } | | k } | s t j d | f d | | f  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 }  t  |   } d } | | k } | st j d | f d | | f  d t j |  d d t j   k sdt j t   rst j t   n d d t j |   d	 t j |  i } d d | i } t t j |    d  }  } } } d  S)Nz,2006-05-30 20:45:26 +0200 (Tue, 30 May 2006)i|Dr   0%(py4)s
{%(py4)s = %(py0)s(%(py2)s)
} == %(py7)sr   r   r   r   r    r   assert %(py9)sr   z,2003-10-27 20:43:14 +0100 (Mon, 27 Oct 2003)ib?)r   )rC  rD  )r   )rC  rD  )	r   r3   r4   r8   r5   r6   r7   r9   r:   )rB   rD   rH   rM   rF   rO   rR   rR   rS   test_parse_wcinfotime  s$                    rE  c               @   s(   e  Z d  Z d d   Z d d   Z d S)TestInfoSvnWCCommandc       
      C   s  d } t  j j t  j   j   } z t |  } Wd  | j   X| 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 sr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 s?t j |  rNt j |  n d d t j |  d t j |  i } d d | i }	 t t j |	    d  } } } | j } d } | | k } | sh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 } | s5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 st j |  rt j |  n d d t j |  d t j |  i } d' d | i }	 t t j |	    d  } } } d  S)(Naa  
        Path: test_svnwc.py
        Name: test_svnwc.py
        URL: http://codespeak.net/svn/py/dist/py/path/svn/wccommand.py
        Repository UUID: fd0d7bf2-dfb6-0310-8d31-b7ecfe96aada
        Revision: 28137
        Node Kind: file
        Schedule: normal
        Last Changed Author: jan
        Last Changed Rev: 27939
        Last Changed Date: 2006-05-30 20:45:26 +0200 (Tue, 30 May 2006)
        Text Last Updated: 2006-06-01 00:42:53 +0200 (Thu, 01 Jun 2006)
        Properties Last Updated: 2006-05-23 11:54:59 +0200 (Tue, 23 May 2006)
        Checksum: 357e44880e5d80157cc5fbc3ce9822e3
        janr   3%(py2)s
{%(py2)s = %(py0)s.last_author
} == %(py5)sr   r?   r   r   r   assert %(py7)sr   r   ,%(py2)s
{%(py2)s = %(py0)s.kind
} == %(py5)sg  +A-%(py2)s
{%(py2)s = %(py0)s.mtime
} == %(py5)sz9http://codespeak.net/svn/py/dist/py/path/svn/wccommand.py+%(py2)s
{%(py2)s = %(py0)s.url
} == %(py5)sg TC,%(py2)s
{%(py2)s = %(py0)s.time
} == %(py5)sim  +%(py2)s
{%(py2)s = %(py0)s.rev
} == %(py5)s)r   )rH  rI  )r   )rJ  rI  )r   )rK  rI  )r   )rL  rI  )r   )rM  rI  )r   )rN  rI  )r)   r0   r   __file__r(  chdirr   last_authorr3   r4   r5   r6   r7   r8   r9   r:   kindmtimer   timer$   )
re   r@   outputr0   r?   rB   rC   rD   rE   rF   rR   rR   rS   test_svn_1_2  sj    	    y   	    y   	    y   	    y   	    y   	    y   z!TestInfoSvnWCCommand.test_svn_1_2c       
      C   s  d } t  j j t  j   j   } z t |  } Wd  | j   X| 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 sr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 s?t j |  rNt j |  n d d t j |  d t j |  i } d d | i }	 t t j |	    d  } } } | j } d } | | k } | sh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 } | s5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 st j |  rt j |  n d d t j |  d t j |  i } d' d | i }	 t t j |	    d  } } } d  S)(Na  
        Path: test_svnwc.py
        Name: test_svnwc.py
        URL: http://codespeak.net/svn/py/dist/py/path/svn/wccommand.py
        Repository Root: http://codespeak.net/svn
        Repository UUID: fd0d7bf2-dfb6-0310-8d31-b7ecfe96aada
        Revision: 28124
        Node Kind: file
        Schedule: normal
        Last Changed Author: jan
        Last Changed Rev: 27939
        Last Changed Date: 2006-05-30 20:45:26 +0200 (Tue, 30 May 2006)
        Text Last Updated: 2006-06-02 23:46:11 +0200 (Fri, 02 Jun 2006)
        Properties Last Updated: 2006-06-02 23:45:28 +0200 (Fri, 02 Jun 2006)
        Checksum: 357e44880e5d80157cc5fbc3ce9822e3
        rG  r   3%(py2)s
{%(py2)s = %(py0)s.last_author
} == %(py5)sr   r?   r   r   r   assert %(py7)sr   r   ,%(py2)s
{%(py2)s = %(py0)s.kind
} == %(py5)sg  +A-%(py2)s
{%(py2)s = %(py0)s.mtime
} == %(py5)sz9http://codespeak.net/svn/py/dist/py/path/svn/wccommand.py+%(py2)s
{%(py2)s = %(py0)s.url
} == %(py5)sim  +%(py2)s
{%(py2)s = %(py0)s.rev
} == %(py5)sg TC,%(py2)s
{%(py2)s = %(py0)s.time
} == %(py5)s)r   )rW  rX  )r   )rY  rX  )r   )rZ  rX  )r   )r[  rX  )r   )r\  rX  )r   )r]  rX  )r)   r0   r   rO  r(  rP  r   rQ  r3   r4   r5   r6   r7   r8   r9   r:   rR  rS  r   r$   rT  )
re   r@   rU  r0   r?   rB   rC   rD   rE   rF   rR   rR   rS   test_svn_1_3  sj    	    y   	    y   	    y   	    y   	    y   	    y   z!TestInfoSvnWCCommand.test_svn_1_3N)r<  r=  r>  rV  r^  rR   rR   rR   rS   rF    s   rF  c               C   s   t  j j t d  d  S)Nzpy.path.svnwc('/tmp/@@@:'))r)   rq   r%  
ValueErrorrR   rR   rR   rS   test_characters_at  s    r`  c               C   s   t  j j d  d  S)Nz
/tmp/test~)r)   r0   r   rR   rR   rR   rS   test_characters_tilde  s    ra  c               @   sX   e  Z d  Z d d   Z d d   Z d d   Z d d   Z d	 d
   Z d d   Z d S)TestRepoc             C   s   | j  d  } | | 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)Nr	   r   %(py0)s == %(py2)sr   r@   r   r   r   assert %(py4)sr    )r   )rc  rd  )	r(   r3   r4   r5   r6   r7   r8   r9   r:   )re   r@   r   rB   rk   r   rR   rR   rS   test_trailing_slash_is_stripped  s         z(TestRepo.test_trailing_slash_is_strippedc             C   s   | j  } |   } | s d d d d t j   k sC t j |  rR t j |  n d d t j |  d t j |  i } t t j |    d  } } d  S)Nr   z@assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}r   r@   r   r    )r   r5   r6   r3   r7   r8   r9   r:   )re   r@   rB   rD   r   rR   rR   rS   test_exists_svn_root  s    	 	  b  zTestRepo.test_exists_svn_rootc             C   s  t  j   } | j | j d  | j | 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 |  i } d d
 | i } t t j |    d  } } | j }	 | |	 k } | st j d | f d | |	 f  d d t j	   k sN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)N*   rq   r   %(py0)s == %(py3)sr   r$   r   r   assert %(py5)sr   /%(py0)s == %(py4)s
{%(py4)s = %(py2)s.strpath
}r   r   r@   r    assert %(py6)sr   )r   )rh  ri  )r   )rj  rk  )	svncommon	RepoCacheputstrpathgetr(   r3   r4   r5   r6   r7   r8   r9   r:   )re   r@   	repocacher   r$   rG   rB   rQ   rE   rD   r   r   rR   rR   rS   test_repocache_simple  s"    !   j   
	      zTestRepo.test_repocache_simplec             C   s  t  j   } d | _ | j | j | j  | 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 |  i } d d
 | i }	 t t j |	    d  } } } | j }
 | |
 k } | st j d | f d | |
 f  d d t	 j
   k s\t j |  rk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   r   %(py0)s == -%(py3)sr   r$   r   r   assert %(py6)sr   /%(py0)s == %(py4)s
{%(py4)s = %(py2)s.strpath
}r   r   r@   r    )r   )rs  rt  )r   )ru  rt  )rl  rm  timeoutrn  ro  r$   rp  r3   r4   r5   r6   r7   r8   r9   r:   )re   r@   rq  r   r$   rG   rC   rB   r   r   rD   rR   rR   rS   test_repocache_notimeout  s&    	    j   	      z!TestRepo.test_repocache_notimeoutc             C   s  t  j   } | j | j d d d | j | 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 |  i } d d | i }	 t t j |	    d  } } } | j }
 | |
 k } | st j d | f d | |
 f  d d t j	   k s_t j
 |  rn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)Nrg  	timestampr   rq   r   r   %(py0)s == -%(py3)sr   r$   r   r   assert %(py6)sr   /%(py0)s == %(py4)s
{%(py4)s = %(py2)s.strpath
}r   r   r@   r    )r   )ry  rz  )r   )r{  rz  )rl  rm  rn  ro  rp  r(   r3   r4   r5   r6   r7   r8   r9   r:   )re   r@   rq  r   r$   rG   rC   rB   r   r   rD   rR   rR   rS   test_repocache_outdated  s$    !    j   	      z TestRepo.test_repocache_outdatedc             C   s  t  j j } zt j   t j d d  } t j 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 |  i } d d
 | i } t t j |    d } } | t k } | st j d | f d | t f  d d t j   k sKt j |  rZt j |  n d d d t j   k st j t  rt j t  n d i }	 d d |	 i }
 t t j |
    d } Wd | t _ Xd S)z. this test runs so slow it's usually disabled r$   r   r   >=%(py0)s >= %(py3)sr   r   r   assert %(py5)sr   Nr   %(py0)s == %(py2)sr   r   
svnrepourlassert %(py4)sr    )r}  )r~  r  )r   )r  r  )rl  repositoriesreposZ
_repocacheclearr@   newcacherq  rp  ro  r3   r4   r5   r6   r7   r8   r9   r:   r  )re   oldr*  r   r$   rG   rB   rQ   rE   rk   r   rR   rR   rS   _test_getreporev  s&    
   j   
     
zTestRepo._test_getreporevN)	r<  r=  r>  re  rf  rr  rw  r|  r  rR   rR   rR   rS   rb    s   	rb  )builtinsr5   _pytest.assertion.rewrite	assertionrewriter3   r)   osr,   r?  Zpy._path.svnwcr   r   r   Zpy._pathr   rl  svntestbaser   rT   rY   rZ   rB  rE  rF  r`  ra  rb  rR   rR   rR   rS   <module>   s"      m=