ó
|‰ãWÏ>  c           @   sE  d  d l  Z d  d l j j Z d  d l Z d  d l Z d  d l m	 Z	 d  d l
 Z
 d  d l Z e j j j d ƒ Z d „  Z d „  Z d e f d „  ƒ  YZ d e j j f d	 „  ƒ  YZ d
 e f d „  ƒ  YZ d e j j f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z d d d „  ƒ  YZ d d d „  ƒ  YZ d d d „  ƒ  YZ d S(   iÿÿÿÿN(   t   SvnAutht   svnc         C   s¶   t  j j |  ƒ j d ƒ } | j d ƒ j d ƒ d } d } xF | D]> } | d | | | d f 7} | d | | | d f 7} qD W| j d	 ƒ j | ƒ | j d
 ƒ j | ƒ d S(   s×    write config to repo

        user information in userdata is used for auth
        userdata has user names as keys, and a tuple (password, readwrite) as
        values, where 'readwrite' is either 'r' or 'rw'
    t   confs   svnserve.confsT   [general]
anon-access = none
password-db = passwd
authz-db = authz
realm = TestRepo
s   [/]
s   [users]
s   %s = %s
i   i    t   authzt   passwdN(   t   pyt   patht   localt   joint   write(   t   repot   userdatat   confdirt	   authzdatat
   passwddatat   user(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   make_repo_auth	   s     c         C   s,  t  j j |  ƒ j d ƒ } d } d  } xë | d k  rd | | |  f } | GHy t  j j | ƒ Wn* t  j j j k
 rŽ t j	 ƒ  d } ny Xd } } x[ | d k  rö | d 7} y | j
 ƒ  } Wn t  j j k
 rÛ n X| ræ Pn  t j d ƒ qœ W| t | ƒ f S| d 7} q* Wt d	 | f ƒ ‚ d  S(
   Nt   pidi'  i'  s3   svnserve -d -T --listen-port=%d --pid-file=%s -r %si   i    i
   gš™™™™™É?s   could not start svnserve: %s(   R   R   R   R   t   Nonet   processt   cmdexect   Errort   syst   exc_infot   readt   errort   ENOENTt   timet   sleept   intt   IOError(   t   repopatht   pidfilet   portt   et   cmdt   counterR   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   serve_bg    s0    

t   TestSvnAuthc           B   s>   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c   	      C   sw  t  d d ƒ } | j } d } | | k } | sÕ t j d | f d | | f ƒ i d t j ƒ  k sr t j | ƒ r t j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } } | j } d } | | k } | s©t j d | f d | | f ƒ i d t j ƒ  k sFt j | ƒ rUt j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } } t | ƒ } | smd	 d i d t j ƒ  k sôt j t ƒ rt j t ƒ n d d 6d t j ƒ  k s+t j | ƒ r:t j | ƒ n d d 6t j | ƒ d 6} t t j	 | ƒ ƒ ‚ n  d  } d  S(   Nt   foot   bars   ==s0   %(py2)s
{%(py2)s = %(py0)s.username
} == %(py5)st   autht   py0t   py2t   py5t    s   assert %(py7)st   py7s0   %(py2)s
{%(py2)s = %(py0)s.password
} == %(py5)ss,   assert %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}t   strt   py1t   py3(   s   ==(   s0   %(py2)s
{%(py2)s = %(py0)s.username
} == %(py5)ss   assert %(py7)s(   s   ==(   s0   %(py2)s
{%(py2)s = %(py0)s.password
} == %(py5)ss   assert %(py7)s(   R    t   usernamet
   @pytest_art   _call_reprcomparet   @py_builtinst   localst   _should_repr_global_namet	   _safereprt   AssertionErrort   _format_explanationR   t   passwordR/   (	   t   selfR)   t   @py_assert1t   @py_assert4t   @py_assert3t   @py_format6t   @py_format8t   @py_assert2t   @py_format4(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt
   test_basic>   s,    	    |   	    |     Œ  c         C   s  t  d d ƒ } | j } | ƒ  } d } | | k } | sî t j d | f d | | f ƒ i d t j ƒ  k s{ t j | ƒ rŠ t j | ƒ n d d 6t j | ƒ d 6t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } } } d  S(   NR'   R(   s!   --username="foo" --password="bar"s   ==sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.makecmdoptions
}()
} == %(py7)sR)   R*   R+   t   py4R.   R-   s   assert %(py9)st   py9(   s   ==(   sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.makecmdoptions
}()
} == %(py7)ss   assert %(py9)s(   R    t   makecmdoptionsR3   R4   R5   R6   R7   R8   R9   R:   R   (   R<   R)   R=   R?   t   @py_assert6t   @py_assert5RA   t   @py_format10(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt$   test_makecmdoptions_uname_pw_makestrD   s    	 	    Œ   c         C   s  t  d d ƒ } | j } | ƒ  } d } | | k } | sî t j d | f d | | f ƒ i d t j ƒ  k s{ t j | ƒ rŠ t j | ƒ n d d 6t j | ƒ d 6t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } } } d  S(   Ns   fo"os   "ba'r"s(   --username="fo\"o" --password="\"ba'r\""s   ==sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.makecmdoptions
}()
} == %(py7)sR)   R*   R+   RE   R.   R-   s   assert %(py9)sRF   (   s   ==(   sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.makecmdoptions
}()
} == %(py7)ss   assert %(py9)s(   R    RG   R3   R4   R5   R6   R7   R8   R9   R:   R   (   R<   R)   R=   R?   RH   RI   RA   RJ   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt    test_makecmdoptions_quote_escapeH   s    	 	    Œ   c         C   s
  t  d d d t ƒ} | j } | ƒ  } d } | | k } | sô t j d | f d | | f ƒ i d t j ƒ  k s t j | ƒ r t j | ƒ n d d 6t j | ƒ d	 6t j | ƒ d
 6t j | ƒ d 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } } d  S(   NR'   R(   t
   cache_auths1   --username="foo" --password="bar" --no-auth-caches   ==sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.makecmdoptions
}()
} == %(py7)sR)   R*   R+   RE   R.   R-   s   assert %(py9)sRF   (   s   ==(   sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.makecmdoptions
}()
} == %(py7)ss   assert %(py9)s(   R    t   FalseRG   R3   R4   R5   R6   R7   R8   R9   R:   R   (   R<   R)   R=   R?   RH   RI   RA   RJ   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt!   test_makecmdoptions_no_cache_authL   s    	 	    Œ   c         C   s
  t  d d d t ƒ} | j } | ƒ  } d } | | k } | sô t j d | f d | | f ƒ i d t j ƒ  k s t j | ƒ r t j | ƒ n d d 6t j | ƒ d	 6t j | ƒ d
 6t j | ƒ d 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } } d  S(   NR'   R(   t   interactives3   --username="foo" --password="bar" --non-interactives   ==sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.makecmdoptions
}()
} == %(py7)sR)   R*   R+   RE   R.   R-   s   assert %(py9)sRF   (   s   ==(   sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.makecmdoptions
}()
} == %(py7)ss   assert %(py9)s(   R    RN   RG   R3   R4   R5   R6   R7   R8   R9   R:   R   (   R<   R)   R=   R?   RH   RI   RA   RJ   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt"   test_makecmdoptions_no_interactiveQ   s    	 	    Œ   c         C   s  t  d d d t d t ƒ} | j } | ƒ  } d } | | k } | sú t j d | f d | | f ƒ i d t j ƒ  k s‡ t j | ƒ r– t j | ƒ n d d	 6t j | ƒ d
 6t j | ƒ d 6t j | ƒ d 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } } d  S(   NR'   R(   RM   RP   sC   --username="foo" --password="bar" --no-auth-cache --non-interactives   ==sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.makecmdoptions
}()
} == %(py7)sR)   R*   R+   RE   R.   R-   s   assert %(py9)sRF   (   s   ==(   sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.makecmdoptions
}()
} == %(py7)ss   assert %(py9)s(   R    RN   RG   R3   R4   R5   R6   R7   R8   R9   R:   R   (   R<   R)   R=   R?   RH   RI   RA   RJ   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt0   test_makecmdoptions_no_interactive_no_cache_authV   s    		 	    Œ   (   t   __name__t
   __module__RD   RK   RL   RO   RQ   RR   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyR&   =   s   					t   svnwc_no_svnc           B   s   e  Z d  „  Z d „  Z RS(   c         O   s+   t  t |  ƒ j |  | | Ž } g  | _ | S(   N(   t   superRU   t   __new__t   commands(   t   clst   argst   kwargsR<   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyRW   ]   s    	c         G   s   |  j  j | ƒ d  S(   N(   RX   t   append(   R<   RZ   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   _svnb   s    (   RS   RT   RW   R]   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyRU   \   s   	t   TestSvnWCAuthc           B   s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s5   t  s t j j d ƒ n  t d d d t ƒ|  _ d  S(   Ns   svn binary requiredR   t   passRM   (   t   svnbinR   t   testt   skipR    RN   R)   (   R<   t   meth(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   setup_methodf   s    c         C   sË   t  d d |  j ƒ} | j d ƒ | j d d } d } | | k } | s¹ t j d | f d | | f ƒ i t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } d  S(   NR'   R)   t   urli    iÿÿÿÿs3   --username="user" --password="pass" --no-auth-caches   ==s   %(py1)s == %(py4)sR0   RE   R-   s   assert %(py6)st   py6(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(
   RU   R)   t   checkoutRX   R3   R4   R8   R9   R:   R   (   R<   t   wct   @py_assert0R?   RB   t   @py_format5t   @py_format7(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_checkoutk   s        E   c         C   sË   t  d d |  j ƒ} | j d ƒ | j d d } d } | | k } | s¹ t j d | f d | | f ƒ i t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } d  S(   NR'   R)   t   msgi    iÿÿÿÿs3   --username="user" --password="pass" --no-auth-caches   ==s   %(py1)s == %(py4)sR0   RE   R-   s   assert %(py6)sRf   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(
   RU   R)   t   commitRX   R3   R4   R8   R9   R:   R   (   R<   Rh   Ri   R?   RB   Rj   Rk   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_commitq   s        E   c         C   sË   t  d d |  j ƒ} | j d ƒ | j d d } d } | | k } | s¹ t j d | f d | | f ƒ i t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } d  S(   NR'   R)   Re   i    iÿÿÿÿs3   --username="user" --password="pass" --no-auth-caches   ==s   %(py1)s == %(py4)sR0   RE   R-   s   assert %(py6)sRf   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(
   RU   R)   Rg   RX   R3   R4   R8   R9   R:   R   (   R<   Rh   Ri   R?   RB   Rj   Rk   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_checkout_no_cache_authw   s        E   c         C   sË   t  d d |  j ƒ} | j d ƒ | j d d } d } | | k } | s¹ t j d | f d | | f ƒ i t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } d  S(   NR'   R)   Re   i    iÿÿÿÿs3   --username="user" --password="pass" --no-auth-caches   ==s   %(py1)s == %(py4)sR0   RE   R-   s   assert %(py6)sRf   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(
   RU   R)   Rg   RX   R3   R4   R8   R9   R:   R   (   R<   Rh   Ri   R?   RB   Rj   Rk   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt#   test_checkout_auth_from_constructor}   s        E   (   RS   RT   Rd   Rl   Ro   Rp   Rq   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyR^   e   s
   				t   svnurl_no_svnc           B   s/   e  Z d  Z d  Z d „  Z d „  Z d „  Z RS(   Ra   c         O   s+   t  t |  ƒ j |  | | Ž } g  | _ | S(   N(   RV   Rr   RW   RX   (   RY   RZ   R[   R<   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyRW   †   s    	c         C   s   |  j  j | ƒ |  j S(   N(   RX   R\   t   cmdexec_output(   R<   R#   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   _cmdexec‹   s    c         C   s   |  j  j | ƒ |  j S(   N(   RX   R\   t   popen_output(   R<   R#   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   _popen   s    (   RS   RT   Rs   Ru   RW   Rt   Rv   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyRr   ƒ   s
   		t   TestSvnURLAuthc           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 RS(   c         C   s   t  d d ƒ |  _ d  S(   NR'   R(   (   R    R)   (   R<   Rc   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyRd   ”   s    c         C   s$  t  d ƒ } | j } | d  k } | só t j d | f d | d  f ƒ i d t j ƒ  k si t j | ƒ rx t j | ƒ n d d 6t j | ƒ d 6d t j ƒ  k s° t j d  ƒ r¿ t j d  ƒ n d d 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } t  d d |  j ƒ} | j } |  j } | | k } | st j d | f d | | f ƒ i d t j ƒ  k sxt j | ƒ r‡t j | ƒ n d d 6t j | ƒ d 6d t j ƒ  k s¿t j |  ƒ rÎt j |  ƒ n d d 6t j | ƒ d 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } d  S(   Ns   http://foo.bar/svnt   iss,   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py4)st   uR*   R+   R   RE   R-   s   assert %(py6)sRf   R)   sF   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py6)s
{%(py6)s = %(py4)s.auth
}R<   s   assert %(py8)st   py8(   Rx   (   s,   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py4)ss   assert %(py6)s(   Rx   (   sF   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py6)s
{%(py6)s = %(py4)s.auth
}s   assert %(py8)s(   Rr   R)   R   R3   R4   R5   R6   R7   R8   R9   R:   (   R<   Ry   R=   R?   Rj   Rk   RI   t   @py_format9(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt	   test_init—   s"    	   £   
	 	   ³   c         C   s  t  d d |  j ƒ} | j d d ƒ } | j } |  j } | | k } | s't j d | f d | | f ƒ i d t j ƒ  k s t j | ƒ rœ t j | ƒ n d d 6t j | ƒ d	 6d
 t j ƒ  k sÔ t j |  ƒ rã t j |  ƒ n d
 d 6t j | ƒ d 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } | j } d } | | k } | sût j d | f d | | f ƒ i d t j ƒ  k s˜t j | ƒ r§t j | ƒ n d d 6t j | ƒ d	 6t j | ƒ d 6}	 d i |	 d 6}
 t	 t j
 |
 ƒ ƒ ‚ n  d  } } } d  S(   Ns   http://foo.bar/svn/fooR)   t   basenameR(   Rx   sF   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py6)s
{%(py6)s = %(py4)s.auth
}t   newR*   R+   R<   RE   Rf   R-   s   assert %(py8)sRz   s   http://foo.bar/svn/bars   ==s+   %(py2)s
{%(py2)s = %(py0)s.url
} == %(py5)sR,   s   assert %(py7)sR.   (   Rx   (   sF   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py6)s
{%(py6)s = %(py4)s.auth
}s   assert %(py8)s(   s   ==(   s+   %(py2)s
{%(py2)s = %(py0)s.url
} == %(py5)ss   assert %(py7)s(   Rr   R)   R~   R3   R4   R5   R6   R7   R8   R9   R:   R   Re   (   R<   Ry   R~   R=   RI   R?   Rk   R{   R>   R@   RA   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_newž   s$    	 	   ³   	    |   c         C   s
  t  d d |  j ƒ} | j d ƒ } | j } |  j } | | k } | s$t j d | f d | | f ƒ i d t j ƒ  k sŠ t j | ƒ r™ t j | ƒ n d d 6t j | ƒ d 6d	 t j ƒ  k sÑ t j |  ƒ rà t j |  ƒ n d	 d
 6t j | ƒ d 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } | j } d } | | k } | søt j d | f d | | f ƒ i d t j ƒ  k s•t j | ƒ r¤t j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6}	 d i |	 d 6}
 t	 t j
 |
 ƒ ƒ ‚ n  d  } } } d  S(   Ns   http://foo.bar/svnR)   R'   Rx   sF   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py6)s
{%(py6)s = %(py4)s.auth
}R~   R*   R+   R<   RE   Rf   R-   s   assert %(py8)sRz   s   http://foo.bar/svn/foos   ==s+   %(py2)s
{%(py2)s = %(py0)s.url
} == %(py5)sR,   s   assert %(py7)sR.   (   Rx   (   sF   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py6)s
{%(py6)s = %(py4)s.auth
}s   assert %(py8)s(   s   ==(   s+   %(py2)s
{%(py2)s = %(py0)s.url
} == %(py5)ss   assert %(py7)s(   Rr   R)   R   R3   R4   R5   R6   R7   R8   R9   R:   R   Re   (   R<   Ry   R~   R=   RI   R?   Rk   R{   R>   R@   RA   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt	   test_join¤   s$    	 	   ³   	    |   c         C   sÓ  t  d d |  j ƒ} d | _ | j ƒ  } | d } | j } |  j } | | k } | st j d | f d | | f ƒ i t j | ƒ d 6t j | ƒ d 6d	 t j ƒ  k sº t j	 |  ƒ rÉ t j |  ƒ n d	 d
 6t j | ƒ d 6} d i | d 6} t
 t j | ƒ ƒ ‚ n  d  } } } } | d } | j } |  j } | | k } | st j d | f d | | f ƒ i t j | ƒ d 6t j | ƒ d 6d	 t j ƒ  k s¯t j	 |  ƒ r¾t j |  ƒ n d	 d
 6t j | ƒ d 6} d i | d 6} t
 t j | ƒ ƒ ‚ n  d  } } } } | d } | j } d }	 | |	 k } | s½t j d | f d | |	 f ƒ i t j | ƒ d 6t j | ƒ d 6t j |	 ƒ d 6}
 d i |
 d 6} t
 t j | ƒ ƒ ‚ n  d  } } } }	 d  S(   Ns   http://foo.bar/svnR)   sm      1717 johnny           1529 Nov 04 14:32 LICENSE.txt
   1716 johnny           5352 Nov 04 14:28 README.txt
i    Rx   sF   %(py3)s
{%(py3)s = %(py1)s.auth
} is %(py7)s
{%(py7)s = %(py5)s.auth
}R0   R1   R<   R,   R.   R-   s   assert %(py9)sRF   i   s   LICENSE.txts   ==s0   %(py3)s
{%(py3)s = %(py1)s.basename
} == %(py6)sRf   s   assert %(py8)sRz   (   Rx   (   sF   %(py3)s
{%(py3)s = %(py1)s.auth
} is %(py7)s
{%(py7)s = %(py5)s.auth
}s   assert %(py9)s(   Rx   (   sF   %(py3)s
{%(py3)s = %(py1)s.auth
} is %(py7)s
{%(py7)s = %(py5)s.auth
}s   assert %(py9)s(   s   ==(   s0   %(py3)s
{%(py3)s = %(py1)s.basename
} == %(py6)ss   assert %(py8)s(   Rr   R)   Rs   t   listdirR3   R4   R8   R5   R6   R7   R9   R:   R   R}   (   R<   Ry   t   pathsRi   RB   RH   R>   RA   RJ   RI   Rk   R{   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_listdirª   s<    	
 	 	   Œ   
 	 	   Œ   
 	    U   c   
      C   s4  t  d d |  j ƒ} d „  } d | _ | j j } | | j _ z | j ƒ  } Wd  | | _ X| j } d } | | k } | s"t j d | f d | | f ƒ i d t	 j
 ƒ  k s¿ t j | ƒ rÎ t j | ƒ n d d	 6t j | ƒ d
 6t j | ƒ d 6} d i | d 6}	 t t j |	 ƒ ƒ ‚ n  d  } } } d  S(   Ns   http://foo.bar/svn/LICENSE.txtR)   c         S   s   |  S(   N(    (   R<   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   dirpath·   s    sm      1717 johnny           1529 Nov 04 14:32 LICENSE.txt
   1716 johnny           5352 Nov 04 14:28 README.txt
iù  s   ==s,   %(py2)s
{%(py2)s = %(py0)s.size
} == %(py5)st   infoR*   R+   R,   R-   s   assert %(py7)sR.   (   s   ==(   s,   %(py2)s
{%(py2)s = %(py0)s.size
} == %(py5)ss   assert %(py7)s(   Rr   R)   Rs   t	   __class__R„   R…   t   sizeR3   R4   R5   R6   R7   R8   R9   R:   R   (
   R<   Ry   R„   t   org_dpR…   R=   R>   R?   R@   RA   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt	   test_infoµ   s     		
	    |   c         C   s˜  t  d d |  j ƒ} | j d ƒ } d „  | _ | j ƒ  } d } | | k } | sé t j d | f d | | f ƒ i d t j ƒ  k s– t j	 | ƒ r¥ t j
 | ƒ n d d	 6t j
 | ƒ d
 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } d } | j d }	 | |	 k } | s†t j d | f d | |	 f ƒ i t j
 | ƒ d 6t j
 |	 ƒ d 6}
 d i |
 d 6} t t j | ƒ ƒ ‚ n  d  } } }	 d  S(   Ns   http://foo.bar/svnR)   R'   c          _   s   t  S(   N(   t   True(   RZ   R[   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   <lambda>È   s    Ra   s   ==s   %(py0)s == %(py3)st   retR*   R1   R-   s   assert %(py5)sR,   s!   --username="foo" --password="bar"i    t   ins   %(py1)s in %(py4)sR0   RE   s   assert %(py6)sRf   (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   R   (   s   %(py1)s in %(py4)ss   assert %(py6)s(   Rr   R)   R   t   checkt   openR3   R4   R5   R6   R7   R8   R9   R:   R   RX   (   R<   Ry   R'   RŒ   RB   R=   RC   R@   Ri   R?   Rj   Rk   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt	   test_openÅ   s&       l   
    E   c         C   s3  t  d d |  j ƒ} | j ƒ  } | j } |  j } | | k } | s!t j d | f d | | f ƒ i d t j ƒ  k s‡ t j | ƒ r– t j | ƒ n d d 6t j | ƒ d 6d t j ƒ  k sÎ t j |  ƒ rÝ t j |  ƒ n d d	 6t j | ƒ d
 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } d  S(   Ns   http://foo.bar/svn/fooR)   Rx   sF   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py6)s
{%(py6)s = %(py4)s.auth
}t   parentR*   R+   R<   RE   Rf   R-   s   assert %(py8)sRz   (   Rx   (   sF   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py6)s
{%(py6)s = %(py4)s.auth
}s   assert %(py8)s(   Rr   R)   R„   R3   R4   R5   R6   R7   R8   R9   R:   R   (   R<   Ry   R‘   R=   RI   R?   Rk   R{   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_dirpathÍ   s    	 	   ³   c   
      C   sÙ  t  d d |  j ƒ} | j } | } | s˜ d d i d t j ƒ  k sV t j | ƒ re t j | ƒ n d d 6t j | ƒ d 6} t t j	 | ƒ ƒ ‚ n  d  } } | j d d	 ƒ | j } | s.d d
 i d t j ƒ  k sì t j | ƒ rû t j | ƒ n d d 6t j | ƒ d 6} t t j	 | ƒ ƒ ‚ n  d  } d } | j d } | | k } | sÇt j d | f d | | f ƒ i t j | ƒ d 6t j | ƒ d 6} d i | d 6}	 t t j	 |	 ƒ ƒ ‚ n  d  } } } d  S(   Ns   http://foo.bar/svn/qweqweR)   R-   s0   assert not %(py2)s
{%(py2)s = %(py0)s.commands
}Ry   R*   R+   Rm   s   created dir foos,   assert %(py2)s
{%(py2)s = %(py0)s.commands
}s!   --username="foo" --password="bar"i    R   s   %(py1)s in %(py4)sR0   RE   s   assert %(py6)sRf   (   R   (   s   %(py1)s in %(py4)ss   assert %(py6)s(   Rr   R)   RX   R5   R6   R3   R7   R8   R9   R:   R   t   mkdirR4   (
   R<   Ry   R=   R?   RC   t   @py_format3Ri   RB   Rj   Rk   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt
   test_mkdirÒ   s*    	   U  
	  U      E   c         C   sÖ   t  d d |  j ƒ} t  d ƒ } | j | d ƒ d } | j d } | | k } | sÄ t j d | f d | | f ƒ i t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } d  S(   Ns   http://foo.bar/svnR)   s   http://foo.bar/svn2s
   copied dirs!   --username="foo" --password="bar"i    R   s   %(py1)s in %(py4)sR0   RE   R-   s   assert %(py6)sRf   (   R   (   s   %(py1)s in %(py4)ss   assert %(py6)s(
   Rr   R)   t   copyRX   R3   R4   R8   R9   R:   R   (   R<   Ry   t   u2Ri   R?   RB   Rj   Rk   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt	   test_copyÙ   s        E   c         C   sÊ   t  d d |  j ƒ} | j d d ƒ d } | j d } | | k } | s¸ t j d | f d | | f ƒ i t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } d  S(   Ns   http://foo.bar/svn/fooR)   s   http://foo.bar/svn/bars   moved foo to bars!   --username="foo" --password="bar"i    R   s   %(py1)s in %(py4)sR0   RE   R-   s   assert %(py6)sRf   (   R   (   s   %(py1)s in %(py4)ss   assert %(py6)s(
   Rr   R)   t   renameRX   R3   R4   R8   R9   R:   R   (   R<   Ry   Ri   R?   RB   Rj   Rk   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_renameß   s        E   c         C   sÊ   t  d d |  j ƒ} | j d d ƒ d } | j d } | | k } | s¸ t j d | f d | | f ƒ i t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } d  S(   Ns   http://foo.bar/svn/fooR)   Rm   s   removing foos!   --username="foo" --password="bar"i    R   s   %(py1)s in %(py4)sR0   RE   R-   s   assert %(py6)sRf   (   R   (   s   %(py1)s in %(py4)ss   assert %(py6)s(
   Rr   R)   t   removeRX   R3   R4   R8   R9   R:   R   (   R<   Ry   Ri   R?   RB   Rj   Rk   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_removeä   s        E   c         C   sÙ   t  d d |  j ƒ} t j j d ƒ } | j | ƒ d } | j d } | | k } | sÇ t j d | f d | | f ƒ i t j	 | ƒ d 6t j	 | ƒ d	 6} d i | d 6} t
 t j | ƒ ƒ ‚ n  d  } } } d  S(   Ns   http://foo.bar/svnR)   s   /foos!   --username="foo" --password="bar"i    R   s   %(py1)s in %(py4)sR0   RE   R-   s   assert %(py6)sRf   (   R   (   s   %(py1)s in %(py4)ss   assert %(py6)s(   Rr   R)   R   R   R   t   exportRX   R3   R4   R8   R9   R:   R   (   R<   Ry   t   targetRi   R?   RB   Rj   Rk   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_exporté   s        E   c         C   sÝ  t  d d |  j ƒ} t j j t j j d d ƒ ƒ | _ d „  | _ | j	 d d d t
 ƒ} d	 } | j d
 } | | k } | sð t j d$ | f d% | | f ƒ i t j | ƒ d 6t j | ƒ d 6} d& i | d 6} t t j | ƒ ƒ ‚ n  d  } } } t | ƒ } d } | | k }	 |	 sþt j d' |	 f d( | | f ƒ i d t j ƒ  k sdt j t ƒ rst j t ƒ n d d 6d t j ƒ  k s›t j | ƒ rªt j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6} d) i | d 6}
 t t j |
 ƒ ƒ ‚ n  d  } }	 } | d
 } | j } t | ƒ } d } | | k } | st j d* | f d+ | | f ƒ i d t j ƒ  k s…t j t ƒ r”t j t ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6} d, i | d! 6} t t j | ƒ ƒ ‚ n  d  } } } } } | d
 } | j } d" } | | k }	 |	 sÇt j d- |	 f d. | | f ƒ i t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6} d/ i | d 6}
 t t j |
 ƒ ƒ ‚ n  d  } } }	 } d  S(0   Ns   http://foo.bar/svn/fooR)   sÑ   <?xml version="1.0"?>
<log>
<logentry revision="51381">
<author>guido</author>
<date>2008-02-11T12:12:18.476481Z</date>
<msg>Creating branch to work on auth support for py.path.svn*.
</msg>
</logentry>
</log>
t   asciic          _   s   t  S(   N(   RŠ   (   RZ   R[   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyR‹   ü   s    i
   i   t   verboses!   --username="foo" --password="bar"i    R   s   %(py1)s in %(py4)sR0   RE   R-   s   assert %(py6)sRf   i   s   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)st   lenR*   RŒ   R1   s   assert %(py8)sRz   iµÈ  sI   %(py6)s
{%(py6)s = %(py0)s(%(py4)s
{%(py4)s = %(py2)s.rev
})
} == %(py9)sR   RF   R+   s   assert %(py11)st   py11t   guidos.   %(py3)s
{%(py3)s = %(py1)s.author
} == %(py6)s(   R   (   s   %(py1)s in %(py4)ss   assert %(py6)s(   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   s   ==(   sI   %(py6)s
{%(py6)s = %(py0)s(%(py4)s
{%(py4)s = %(py2)s.rev
})
} == %(py9)ss   assert %(py11)s(   s   ==(   s.   %(py3)s
{%(py3)s = %(py1)s.author
} == %(py6)ss   assert %(py8)s(   Rr   R)   R   t   iot   TextIOt   builtint   _totextRu   RŽ   t   logRŠ   RX   R3   R4   R8   R9   R:   R   R¢   R5   R6   R7   t   revR   t   author(   R<   Ry   RŒ   Ri   R?   RB   Rj   Rk   RI   R>   R{   R=   t   @py_assert8t   @py_assert7RJ   t   @py_format12(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_logï   sP    
    E       ³   
 	     œ   
 	    U   c         C   sÇ   t  d d |  j ƒ} | j d ƒ d } | j d } | | k } | sµ t j d | f d | | f ƒ i t j | ƒ d 6t j | ƒ d	 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } d  S(   Ns   http://foo.bar/svnR)   R'   s!   --username="foo" --password="bar"i    R   s   %(py1)s in %(py4)sR0   RE   R-   s   assert %(py6)sRf   (   R   (   s   %(py1)s in %(py4)ss   assert %(py6)s(
   Rr   R)   t   propgetRX   R3   R4   R8   R9   R:   R   (   R<   Ry   Ri   R?   RB   Rj   Rk   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_propget  s        E   (   RS   RT   Rd   R|   R   R€   Rƒ   R‰   R   R’   R•   R˜   Rš   Rœ   RŸ   R¯   R±   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyRw   “   s   														c         C   s
   t  |  ƒ S(   N(   t   Setup(   t   request(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   pytest_funcarg__setup  s    R²   c           B   s   e  Z d  „  Z RS(   c            sƒ  t  s t j j d ƒ n  | j j j s; t j j d ƒ n  | j d ƒ } | j d ƒ } t j	 j
 d | ƒ t j d k r› d t | ƒ j d d ƒ } n  t j j d	 | ƒ ˆ  _ t j j j d k rÖ | d
 } n  t j j | ƒ ˆ  _ | j d ƒ ˆ  _ t d d d t d t ƒˆ  _ t ˆ  j i d d 6ƒ t ˆ  j j ƒ  ƒ \ ˆ  _ ˆ  _ t j j j j  j! ƒ  | j" ‡  f d †  ƒ d  S(   Ns   svn binary requireds%   use --runslowtests to run these testst   tmpdirR
   s   svnadmin create %st   win32t   /s   \s	   file://%si   t   temppatht   johnnyR'   RM   RP   t   rwc              s   t  j j ˆ  j ƒ S(   N(   R   R   t   killR   (    (   R<   (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyR‹   #  s    (   s   foos   rw(#   R`   R   Ra   Rb   t   configt   optiont   runslowtestst   getfuncargvalueR   R   R   R   t   platformR/   t   replaceR   t   svnurlR
   t   stdR   R   R“   R¸   R    RN   R)   R   R%   R„   R!   R   t   _lsnorevcachet   _dictt   cleart   addfinalizer(   R<   R³   Rµ   t   repodir(    (   R<   s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   __init__  s(    !(   RS   RT   RÉ   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyR²     s   t   TestSvnWCAuthFunctionalc           B   sP   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   c   	      C   s8  t  j j | j d | j ƒ} | j d | j | j j f ƒ | j	 } d } | | ƒ } | j
 } | ƒ  } | sd d i t j | ƒ d 6d t j ƒ  k s¬ t j | ƒ r» t j | ƒ n d d 6t j | ƒ d	 6t j | ƒ d
 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } } } } d  S(   NR)   s   svn://localhost:%s/%ss   .svnR-   sz   assert %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}()
}Rz   Rh   R*   R+   RE   Rf   t   py10(   R   R   t   svnwcR¸   R)   Rg   R!   R   R}   R   RŽ   R3   R8   R5   R6   R7   R9   R:   R   (	   R<   t   setupRh   R=   R?   RI   R­   t   @py_assert9t   @py_format11(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_checkout_constructor_arg&  s    	   	 	  •  c   	      C   s8  t  j j | j d | j ƒ} | j d | j | j j f ƒ | j	 } d } | | ƒ } | j
 } | ƒ  } | sd d i t j | ƒ d 6d t j ƒ  k s¬ t j | ƒ r» t j | ƒ n d d 6t j | ƒ d	 6t j | ƒ d
 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } } } } d  S(   NR)   s   svn://localhost:%s/%ss   .svnR-   sz   assert %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}()
}Rz   Rh   R*   R+   RE   Rf   RË   (   R   R   RÌ   R¸   R)   Rg   R!   R   R}   R   RŽ   R3   R8   R5   R6   R7   R9   R:   R   (	   R<   RÍ   Rh   R=   R?   RI   R­   RÎ   RÏ   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_checkout_function_arg,  s    	   	 	  •  c         C   sQ   t  d d d t d t ƒ} t j j | j | ƒ } t j j t d | j	 ƒ d  S(   NR¹   R(   RM   RP   s4   wc.checkout('svn://localhost:%(port)s/%(repopath)s')(
   R    RN   R   R   RÌ   R¸   Ra   t   raisest	   Exceptiont   __dict__(   R<   RÍ   R)   Rh   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt%   test_checkout_failing_non_interactive2  s    	c         C   s0  t  j j | j | j ƒ } | j d | j | j j f ƒ | j	 d ƒ } | j
 d ƒ | j ƒ  } t | ƒ } d } | | k } | sct j d | f d | | f ƒ i d t j ƒ  k sÉ t j t ƒ rØ t j t ƒ n d d 6d	 t j ƒ  k s t j | ƒ rt j | ƒ n d	 d
 6t j | ƒ d 6t j | ƒ d 6} d i | d 6}	 t t j |	 ƒ ƒ ‚ n  d  } } } | d }
 |
 j } d } | | k } | st j d | f d | | f ƒ i t j |
 ƒ d
 6t j | ƒ d 6t j | ƒ d 6} d i | d 6}	 t t j |	 ƒ ƒ ‚ n  d  }
 } } } d  S(   Ns   svn://localhost:%s/%ss   foo.txts   added foo.txti   s   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sR¢   R*   R©   R0   R1   Rf   R-   s   assert %(py8)sRz   i    s+   %(py3)s
{%(py3)s = %(py1)s.msg
} == %(py6)s(   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   s   ==(   s+   %(py3)s
{%(py3)s = %(py1)s.msg
} == %(py6)ss   assert %(py8)s(   R   R   RÌ   R¸   R)   Rg   R!   R   R}   t   ensureRn   R©   R¢   R3   R4   R5   R6   R7   R8   R9   R:   R   Rm   (   R<   RÍ   Rh   R'   R©   RB   RI   R>   Rk   R{   Ri   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyR¯   :  s.        ³   
 	    U   c   	      C   sv  t  j j | j d | j ƒ} d | j | j j f } | j | ƒ | j	 d d t
 ƒj	 d ƒ j d ƒ | j d ƒ | j	 d d t
 ƒ| j d ƒ | j d ƒ } | j | d	 ƒ | j } d } | | ƒ } | sdd
 d i d t j ƒ  k st j | ƒ rt j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } } d  S(   NR)   s   svn://localhost:%s/%sR'   t   dirs   foo.txts   added foo dir with foo.txt fileR(   s   added bar dirs   /fooR-   sF   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}R*   R+   RE   Rf   (   R   R   RÌ   R¸   R)   R!   R   R}   Rg   RÖ   RŠ   R	   Rn   R   t   switchR5   R6   R3   R7   R8   R9   R:   R   (	   R<   RÍ   Rh   RÂ   R(   R=   R?   RI   Rk   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_switchD  s     %	    u  c         C   sï  t  j j | j j d d t ƒd | j ƒ} t  j j | j j d d t ƒd | j ƒ} | j d | j | j	 j
 f ƒ | j d | j | j	 j
 f ƒ | j d d t ƒ| j d ƒ | j ƒ  | j } d } | | ƒ } | j } | ƒ  } | s¤d d	 i t j | ƒ d
 6d t j ƒ  k s2t j | ƒ rAt j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6}	 t t j |	 ƒ ƒ ‚ n  d  } } } } } t d d d t ƒ}
 |
 | _ t  j j t d ƒ d  S(   Nt   wc1R×   R)   t   wc2s   svn://localhost:%s/%sR'   s   added foo dirR-   sz   assert %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.join
}(%(py4)s)
}.check
}()
}Rz   R*   R+   RE   Rf   RË   t   unknownRP   s   wc2.update()(   R   R   RÌ   R¸   RÖ   RŠ   R)   Rg   R!   R   R}   Rn   t   updateR   RŽ   R3   R8   R5   R6   R7   R9   R:   R   R    RN   Ra   RÒ   RÓ   (   R<   RÍ   RÚ   RÛ   R=   R?   RI   R­   RÎ   RÏ   R)   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_updateP  s.    !!
	   	 	  •  	c         C   sö  | j  } t j j | j d | j ƒ} | j d | | j j f ƒ | j	 d d t
 ƒ| j d ƒ | j d ƒ } | j ƒ  | j ƒ  } | j } | sd d i d t j ƒ  k sÃ t j | ƒ rÒ t j | ƒ n d d	 6t j | ƒ d
 6} t t j | ƒ ƒ ‚ n  d  } | j ƒ  | j ƒ  } | j } | } | s¤d d i d t j ƒ  k sbt j | ƒ rqt j | ƒ n d d	 6t j | ƒ d
 6}	 t t j |	 ƒ ƒ ‚ n  d  } } t d d d t ƒ}
 |
 | _ t j j t d ƒ t j j t d ƒ d  S(   NR)   s   svn://localhost:%s/%sR'   t   files   added foo fileR-   s*   assert %(py2)s
{%(py2)s = %(py0)s.locked
}t   statusR*   R+   s.   assert not %(py2)s
{%(py2)s = %(py0)s.locked
}RÜ   RP   s
   foo.lock()s   foo.unlock()(   R!   R   R   RÌ   R¸   R)   Rg   R   R}   RÖ   RŠ   Rn   R   t   lockRà   t   lockedR5   R6   R3   R7   R8   R9   R:   R   t   unlockR    RN   Ra   RÒ   RÓ   (   R<   RÍ   R!   Rh   R'   Rà   R=   R”   R?   RC   R)   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_lock_unlock_statusb  s4    	
	  U  
	   U  
	c         C   så  | j  } t j j | j d | j ƒ} | j d | | j j f ƒ | j	 d d t
 ƒ| j d ƒ | j ƒ  t | j ƒ  j ƒ } | j d ƒ } | j d ƒ | j ƒ  } d } | | k } | sXt j d | f d | | f ƒ i t j | ƒ d
 6d t j ƒ  k st j | ƒ r$t j | ƒ n d d 6}	 d i |	 d 6}
 t t j |
 ƒ ƒ ‚ n  d  } } | j d ƒ | j ƒ  } | } | sád i d t j ƒ  k s¯t j | ƒ r¾t j | ƒ n d d 6} t t j | ƒ ƒ ‚ n  d  } | j d | ƒ } d } | | k } | s¦t j d | f d | | f ƒ i t j | ƒ d
 6d t j ƒ  k sct j | ƒ rrt j | ƒ n d d 6}	 d i |	 d 6}
 t t j |
 ƒ ƒ ‚ n  d  } } t d d d t ƒ} | | _ t j j t  d ƒ d  S(   NR)   s   svn://localhost:%s/%sR'   Rß   s   added foo fileR(   s   
+bar
R   s   %(py1)s in %(py3)sR0   t   diffR1   R-   s   assert %(py5)sR,   s   added some contents   assert not %(py0)sR*   Rª   RÜ   RP   s   foo.diff(rev=rev)(   R   (   s   %(py1)s in %(py3)ss   assert %(py5)ss   assert not %(py0)s(   R   (   s   %(py1)s in %(py3)ss   assert %(py5)s(!   R!   R   R   RÌ   R¸   R)   Rg   R   R}   RÖ   RŠ   Rn   RÝ   R   Rà   Rª   R   R	   Rå   R3   R4   R8   R5   R6   R7   R9   R:   R   R    RN   Ra   RÒ   RÓ   (   R<   RÍ   R!   Rh   Rª   R'   Rå   Ri   RB   RC   R@   R=   t   @py_format2R)   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt	   test_diffv  sH    	
   l   
  A     l   
	(
   RS   RT   RÐ   RÑ   RÕ   R¯   RÙ   RÞ   Rä   Rç   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyRÊ   %  s   				
			t   TestSvnURLAuthFunctionalc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s¤  | j  } t j j d | | j j f d | j ƒ} | j d ƒ | j ƒ  } t	 | ƒ } d } | | k } | sMt
 j d | f d | | f ƒ i d t j ƒ  k s³ t
 j t	 ƒ rÂ t
 j t	 ƒ n d d 6d	 t j ƒ  k sê t
 j | ƒ rù t
 j | ƒ n d	 d
 6t
 j | ƒ d 6t
 j | ƒ d 6} d i | d 6}	 t t
 j |	 ƒ ƒ ‚ n  d  } } } | d }
 |
 j } | j } | | k } | s>t
 j d | f d | | f ƒ i t
 j |
 ƒ d
 6t
 j | ƒ d 6d t j ƒ  k sët
 j | ƒ rút
 j | ƒ n d d 6t
 j | ƒ d 6} d  i | d 6} t t
 j | ƒ ƒ ‚ n  d  }
 } } } t d d d t ƒ} t j j d | | j j f d | ƒ} t j j t d ƒ d  S(!   Ns   svn://localhost:%s/%sR)   R'   i   s   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sR¢   R*   R‚   R0   R1   Rf   R-   s   assert %(py8)sRz   i    Rx   sF   %(py3)s
{%(py3)s = %(py1)s.auth
} is %(py7)s
{%(py7)s = %(py5)s.auth
}RÍ   R,   R.   s   assert %(py9)sRF   R(   RP   s   u.listdir()(   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   Rx   (   sF   %(py3)s
{%(py3)s = %(py1)s.auth
} is %(py7)s
{%(py7)s = %(py5)s.auth
}s   assert %(py9)s(   R!   R   R   RÂ   R   R}   R)   RÖ   R   R¢   R3   R4   R5   R6   R7   R8   R9   R:   R   R    RN   Ra   RÒ   RÓ   (   R<   RÍ   R!   Ry   R‚   RB   RI   R>   Rk   R{   Ri   RH   RA   RJ   R)   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyRƒ   Ž  s8    		    ³   
 	 	   Œ   		c         C   s  | j  } t j j d | | j j f d | j ƒ} | j d ƒ } | j } | ƒ  } | sØ d d i d t	 j
 ƒ  k s† t j | ƒ r• t j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } | j d	 ƒ } | j | ƒ | j } | ƒ  } | s“d d i d	 t	 j
 ƒ  k sAt j | ƒ rPt j | ƒ n d	 d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } | j } | j }	 | |	 k } | st j d | f d | |	 f ƒ i d	 t	 j
 ƒ  k st j | ƒ rt j | ƒ n d	 d 6t j | ƒ d 6d t	 j
 ƒ  k sJt j | ƒ rYt j | ƒ n d d 6t j |	 ƒ d 6}
 d i |
 d 6} t t j | ƒ ƒ ‚ n  d  } } }	 t d d	 d t ƒ} t j j d | | j j f d | ƒ} | j d ƒ } | j d	 ƒ } t j j t d ƒ d  S(   Ns   svn://localhost:%s/%sR)   R'   R-   s@   assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}R*   R+   RE   R(   Rx   sF   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py6)s
{%(py6)s = %(py4)s.auth
}RÍ   Rf   s   assert %(py8)sRz   RP   s   foo.copy(bar)(   Rx   (   sF   %(py2)s
{%(py2)s = %(py0)s.auth
} is %(py6)s
{%(py6)s = %(py4)s.auth
}s   assert %(py8)s(   R!   R   R   RÂ   R   R}   R)   R“   RŽ   R5   R6   R3   R7   R8   R9   R:   R   R   R–   R4   R    RN   Ra   RÒ   RÓ   (   R<   RÍ   R!   Ry   R'   R=   R?   Rj   R(   RI   Rk   R{   R)   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyR˜   ž  sD    			 	  e  
	 	  e  
	 	   ³   		c         C   s‡  | j  } t j j d | | j j f d | j ƒ} | j d ƒ } | j ƒ  } z | j	 ƒ  } Wd  | j
 ƒ  Xd } | | k } | st j d | f d | | f ƒ i d t j ƒ  k sÇ t j | ƒ rÖ t j | ƒ n d d 6t j | ƒ d	 6}	 d i |	 d 6}
 t t j |
 ƒ ƒ ‚ n  d  } } t d d d t ƒ} t j j d | | j j f d | ƒ} | j d ƒ } t j j t d ƒ d  S(   Ns   svn://localhost:%s/%sR)   R'   R-   s   ==s   %(py0)s == %(py3)st   dataR*   R1   s   assert %(py5)sR,   R(   RP   s
   foo.open()(   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   R!   R   R   RÂ   R   R}   R)   RÖ   R   R   t   closeR3   R4   R5   R6   R7   R8   R9   R:   R   R    RN   R   Ra   RÒ   RÓ   (   R<   RÍ   R!   Ry   R'   t   fpRé   RB   R=   RC   R@   R)   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   test_write_read²  s,    		   l   
		(   RS   RT   Rƒ   R˜   Rì   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyRè     s   		(    (    (    (   t   __builtin__R5   t   _pytest.assertion.rewritet	   assertiont   rewriteR3   R   t   svntestbaset   py.pathR    R   R   R   R   t   sysfindR`   R   R%   t   objectR&   RÌ   RU   R^   RÂ   Rr   Rw   R´   R²   RÊ   Rè   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/path/test_svnauth.pyt   <module>   s$     			u	h