B
    u9a£r  ã               @   sî   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mZ d dlm	Z	m
Z
 d dlmZ d dlmZ yd dlZW n ek
r„   dZY nX ee	jƒZdd„ Zdd	„ ZG d
d„ dejƒZG dd„ de
jejƒZG dd„ dejƒZedkrêe ¡  dS )é    N)ÚrealpathÚabspathÚdirnameÚbasename)ÚsupportÚtest_genericpath)ÚFakePath)Úmockc             C   s"   dt k}d}| t |¡| ƒg| S )z­
    On Windows, posixpath.abspath still returns paths with backslashes
    instead of posix forward slashes. If this is the case, several tests
    fail, so skip them.
    ú\z'ABSTFN is not a posix path - tests fail)ÚABSTFNÚunittestÚskip)ÚtestZfound_backslashÚmsg© r   ú$/usr/lib/python3.7/test_posixpath.pyÚ!skip_if_ABSTFN_contains_backslash   s    r   c             C   s(   yt  | ¡ W n tk
r"   Y nX d S )N)ÚosÚrmdirÚOSError)r   r   r   r   Ú
safe_rmdir   s    r   c               @   sô  e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Ze e ¡ d¡dd„ ƒZe edkd¡dd„ ƒZe edkd¡d d!„ ƒZd"d#„ Zd$d%„ Zd&d'„ Zd(d)„ Zed*d+„ ƒZed,d-„ ƒZe ee d.ƒd/¡ed0d1„ ƒƒZ!e ee d.ƒd/¡ed2d3„ ƒƒZ"e ee d.ƒd/¡ed4d5„ ƒƒZ#e ee d.ƒd/¡ed6d7„ ƒƒZ$e ee d.ƒd/¡ed8d9„ ƒƒZ%e ee d.ƒd/¡ed:d;„ ƒƒZ&e ee d.ƒd/¡ed<d=„ ƒƒZ'e ee d.ƒd/¡ed>d?„ ƒƒZ(d@dA„ Z)dBdC„ Z*dDdE„ Z+dS )FÚPosixPathTestc             C   s   |   ¡  d S )N)ÚtearDown)Úselfr   r   r   ÚsetUp&   s    zPosixPathTest.setUpc             C   s0   x*dD ]"}t  t j| ¡ tt j| ƒ qW d S )N)Ú Ú1Ú2)r   ÚunlinkÚTESTFNr   )r   Úsuffixr   r   r   r   )   s    
zPosixPathTest.tearDownc             C   sŒ   |   t dddd¡d¡ |   t ddd¡d¡ |   t ddd	¡d
¡ |   t dddd¡d¡ |   t ddd¡d¡ |   t ddd¡d¡ d S )Nz/fooÚbarz/barZbazz/bar/bazz/foo/bar/bazz/foo/zbar/zbaz/z/foo/bar/baz/s   /foos   bars   /bars   bazs   /bar/bazs   /foo/bar/bazs   /foo/s   bar/s   baz/s   /foo/bar/baz/)ÚassertEqualÚ	posixpathÚjoin)r   r   r   r   Ú	test_join.   s    zPosixPathTest.test_joinc             C   s¸   |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d	¡d
¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ d S )Nz/foo/bar)z/foor!   ú/)r&   r   Úfoo)r   r'   z////foo)z////r'   z
//foo//bar)z//foor!   s   /foo/bar)s   /foos   baró   /)r(   ó    s   foo)r)   s   foos   ////foo)s   ////s   foos
   //foo//bar)s   //foos   bar)r"   r#   Úsplit)r   r   r   r   Ú
test_split<   s    zPosixPathTest.test_splitc             C   s‚  |   t |¡||f¡ |   t d| ¡d| |f¡ |   t d| ¡d| |f¡ |   t d| ¡d| |f¡ |   t d| ¡d| |f¡ |   t |d ¡|| d df¡ t|dƒ}t|dƒ}t|dƒ}|   t |¡||f¡ |   t d| ¡d| |f¡ |   t d| ¡d| |f¡ |   t d	| ¡d	| |f¡ |   t d
| ¡d
| |f¡ |   t |d ¡|| d df¡ d S )Nr&   zabc/zabc.def/z	/abc.def/r   ÚASCIIr(   s   abc/s   abc.def/s	   /abc.def/r)   )r"   r#   ÚsplitextÚbytes)r   ÚpathÚfilenameZextr   r   r   ÚsplitextTestI   s0    


zPosixPathTest.splitextTestc             C   s¬   |   ddd¡ |   ddd¡ |   ddd¡ |   dd	d
¡ |   ddd¡ |   ddd¡ |   ddd¡ |   ddd¡ |   ddd¡ |   ddd¡ |   ddd¡ |   ddd¡ d S )Nzfoo.barr'   z.barzfoo.boo.barzfoo.boozfoo.boo.biff.barzfoo.boo.biffz.csh.rcz.cshz.rcZnodotsr   z.cshrcz...manydotsz...manydots.extz.extÚ.z..z........)r1   )r   r   r   r   Útest_splitexte   s    zPosixPathTest.test_splitextc             C   s¸   |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d	¡d¡ |   t d
¡d¡ |   t d¡d¡ |   t d¡d¡ d S )Nr   Fr&   Tz/fooz/foo/barzfoo/barr)   r(   s   /foos   /foo/bars   foo/bar)ÚassertIsr#   Úisabs)r   r   r   r   Ú
test_isabss   s    zPosixPathTest.test_isabsc             C   s¸   |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d	¡ |   t d
¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d	¡ d S )Nz/foo/barr!   r&   r   r'   z////fooz
//foo//bars   /foo/bars   barr(   r)   s   foos   ////foos
   //foo//bar)r"   r#   r   )r   r   r   r   Útest_basename€   s    zPosixPathTest.test_basenamec             C   s¸   |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d	¡ |   t d
¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ d S )Nz/foo/barz/foor&   r'   r   z////fooz////z
//foo//barz//foos   /foo/bars   /foor(   s   foor)   s   ////foos   ////s
   //foo//bars   //foo)r"   r#   r   )r   r   r   r   Útest_dirname   s    zPosixPathTest.test_dirnamec          	   C   s  |   t tjd ¡d¡ |   t tjd ¡d¡ ttjd dƒ}| d¡ W d Q R X |   t tjd ¡d¡ t ¡ rþt	 
tjd tjd ¡ |   t tjd ¡d¡ t	 tjd ¡ |   t tjd ¡d¡ |   t tjd ¡d¡ |   t tjd ¡d¡ d S )Nr   Fr   Úwbs   fooT)r4   r#   Úislinkr   r   ÚlexistsÚopenÚwriteÚcan_symlinkr   ÚsymlinkÚremoveÚexists)r   Úfr   r   r   Útest_islinkš   s    zPosixPathTest.test_islinkc             C   s(   |   t d¡d¡ |   t d¡d¡ d S )Nr&   Tr(   )r4   r#   Úismount)r   r   r   r   Útest_ismount¨   s    zPosixPathTest.test_ismountc             C   sB   |   t t¡d¡ z t t¡ |   t t¡d¡ W d ttƒ X d S )NF)r4   r#   rD   r   r   Úmkdirr   )r   r   r   r   Útest_ismount_non_existent¬   s
    
z'PosixPathTest.test_ismount_non_existentzTest requires symlink supportc          	   C   s4   z"t  dt¡ |  t t¡d¡ W d t  t¡ X d S )Nr&   F)r   r?   r   r4   r#   rD   r   )r   r   r   r   Útest_ismount_symlinksµ   s    z#PosixPathTest.test_ismount_symlinksNzTest requires posix modulec             C   s8   t j}dd„ }z|t _|  t t¡d¡ W d |t _X d S )Nc             S   s6   d}d}| t krd}d}t d||dddddddf
¡S )Nr   é   )r   ÚposixÚstat_result)r/   Úst_inoÚst_devr   r   r   Ú
fake_lstatÄ   s    z?PosixPathTest.test_ismount_different_device.<locals>.fake_lstatT)r   Úlstatr4   r#   rD   r   )r   Ú
save_lstatrN   r   r   r   Útest_ismount_different_device¿   s    z+PosixPathTest.test_ismount_different_devicec             C   s8   t j}dd„ }z|t _|  t t¡d¡ W d |t _X d S )Nc             S   sP   d}d}|   t¡r"| tkr"tdƒ‚| tkr2d}d}t d||dddddddf
¡S )Nr   z!Fake [Errno 13] Permission deniedrI   )Ú
startswithr   r   rJ   rK   )r/   rL   rM   r   r   r   rN   Ö   s    zEPosixPathTest.test_ismount_directory_not_readable.<locals>.fake_lstatT)r   rO   r4   r#   rD   r   )r   rP   rN   r   r   r   Ú#test_ismount_directory_not_readableÑ   s    z1PosixPathTest.test_ismount_directory_not_readablec             C   s(   |   t d¡d¡ |   t d¡d¡ d S )Nr'   s   foo)r"   r#   Ú
expanduser)r   r   r   r   Útest_expanduserç   s    zPosixPathTest.test_expanduserc             C   s°   t  ¡ ž}d|d< |  t d¡d¡ d|d< |  t d¡d¡ xbdD ]Z}| j|dD ||d< |  t d¡d¡ |  t d¡d¡ |  t d	¡d
¡ W d Q R X qDW W d Q R X d S )Nz/home/victorÚHOMEú~z/home/victor/)r&   r   z//z///)Úhomer&   z~/z~/fooz/foo)r   ÚEnvironmentVarGuardr"   r#   rT   ZsubTest)r   ÚenvrX   r   r   r   Útest_expanduser_home_envvarë   s    

z)PosixPathTest.test_expanduser_home_envvarc             C   sh  t  d¡}|  t d¡t¡ |  t d¡t¡ t d¡dkrt|  t d¡d t d¡¡ |  t d¡d t d¡¡ |  t d¡t¡ |  t d	¡t¡ |  t d
¡t¡ |  t d¡t¡ t  ¡ š}|d= | 	t
 ¡ ¡j}| d¡pèd}|  t d¡|¡ tjj|dtdF tjj|dtd( x dD ]}|  t |¡|¡ q*W W d Q R X W d Q R X W d Q R X d S )NÚpwdz~/s   ~/rW   r&   ó   ~r(   z~root/z~foo/s   ~root/s   ~foo/rV   Úgetpwuid)Zside_effectÚgetpwnam)rW   z~/.localz
~vstinner/)r   Úimport_moduleZassertIsInstancer#   rT   Ústrr.   r"   rY   r^   r   ÚgetuidÚpw_dirÚrstripr	   ZpatchÚobjectÚKeyError)r   r\   rZ   rX   r/   r   r   r   Útest_expanduser_pwdû   s.    


z!PosixPathTest.test_expanduser_pwdc             C   s   |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d	¡ |   t d
¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ |   t d¡d¡ d S )Nr   r2   r&   z//z///z///foo/.//bar//z/foo/barz///foo/.//bar//.//..//.//bazz/foo/bazz///..//./foo/.//barr)   ó   .r(   s   //s   ///s   ///foo/.//bar//s   /foo/bars   ///foo/.//bar//.//..//.//bazs   /foo/bazs   ///..//./foo/.//bar)r"   r#   Únormpath)r   r   r   r   Útest_normpath"  s"    zPosixPathTest.test_normpathc             C   s”   |   tdƒt ¡ ¡ |   tdƒt ¡ ¡ |   td dgd ¡ƒt ¡ ¡ |   tdƒt ¡ ¡ |   tdƒt ¡ ¡ |   td dgd ¡ƒt ¡ ¡ d S )Nr2   z./.r&   éd   rh   s   ./.r(   )r"   r   r   Úgetcwdr$   Úgetcwdb)r   r   r   r   Útest_realpath_curdir6  s     z"PosixPathTest.test_realpath_curdirc             C   s¤   |   tdƒtt ¡ ƒ¡ |   tdƒttt ¡ ƒƒ¡ |   td dgd ¡ƒd¡ |   tdƒtt ¡ ƒ¡ |   tdƒttt ¡ ƒƒ¡ |   td dgd ¡ƒd¡ d S )Nz..z../..r&   rk   s   ..s   ../..r(   )r"   r   r   r   rl   r$   rm   )r   r   r   r   Útest_realpath_pardir@  s    z"PosixPathTest.test_realpath_pardirr?   zMissing symlink implementationc          	   C   s:   z(t  td t¡ |  ttƒtd ¡ W d t t¡ X d S )Nr   )r   r?   r   r"   r   r   r   )r   r   r   r   Útest_realpath_basicJ  s    z!PosixPathTest.test_realpath_basicc          	   C   s@   z.t  t td ¡t¡ |  ttƒtd ¡ W d t t¡ X d S )Nr   )	r   r?   r#   Úrelpathr   r"   r   r   r   )r   r   r   r   Útest_realpath_relativeU  s    z$PosixPathTest.test_realpath_relativec          
   C   s  zÂt  tt¡ |  ttƒt¡ t  td td ¡ t  td td ¡ |  ttd ƒtd ¡ |  ttd ƒtd ¡ |  ttd ƒtd ¡ |  ttd ƒttƒ¡ |  ttd ƒttƒd ¡ t  td td ¡ |  ttd	 ttƒ d ƒtd ¡ |  ttd	 ttƒ d ƒtd ¡ t  ttƒd
 td ¡ |  ttd ƒtd
 ¡ t  dtttƒƒ d ttƒ d td ¡ |  ttd ƒtd ¡ t ttƒ¡ |  tttƒƒt¡ W d Q R X W d t 	t¡ t 	td ¡ t 	td ¡ t 	td ¡ t 	td ¡ t 	td ¡ X d S )Nr   r   z1/xz1/..z1/../xz/xÚxÚyz1/../za/bÚaz../r&   Úc)
r   r?   r   r"   r   r   r   r   Ú
change_cwdr   )r   r   r   r   Útest_realpath_symlink_loops_  s8    

("
z)PosixPathTest.test_realpath_symlink_loopsc          
   C   sv   zJt  t¡ t  dttƒ td ¡ t  dtd ¡ |  ttd ƒt¡ W d t td ¡ t td ¡ t	tƒ X d S )Nz../z/selfzself/self/selfz/link)
r   rF   r   r?   r   r"   r   r   r   r   )r   r   r   r   Ú(test_realpath_repeated_indirect_symlinks‰  s    
z6PosixPathTest.test_realpath_repeated_indirect_symlinksc             C   sÖ   d}zšt  t¡ x8t|ƒD ],}t  d d| gd ¡td|d   ¡ qW t  dtd ¡ |  ttd|  ƒt¡ t 	t¡ |  td| ƒt¡ W d Q R X W d x&t|d ƒD ]}t 
td|  ¡ q®W ttƒ X d S )Né
   r&   z%dz/%drI   r2   z/0)r   rF   r   Úranger?   r$   r"   r   r   rw   r   r   )r   ÚdepthÚir   r   r   Útest_realpath_deep_recursion˜  s    
,"z*PosixPathTest.test_realpath_deep_recursionc          
   C   sˆ   z^t  t¡ t  td ¡ t  td td ¡ t td ¡ |  tdƒtd ¡ W d Q R X W d t td ¡ t	td ƒ t	tƒ X d S )Nz/yz/kru   z/y/a)
r   rF   r   r?   r   rw   r"   r   r   r   )r   r   r   r   Útest_realpath_resolve_parents¬  s    
"z+PosixPathTest.test_realpath_resolve_parentsc          
   C   sÂ   zŒt  t¡ t  td ¡ t  td ¡ t  td td ¡ |  ttd ƒtd ¡ t ttƒ¡" |  tt	tƒd ƒtd ¡ W d Q R X W d t 
td ¡ ttd ƒ ttd ƒ ttƒ X d S )Nz/kz/k/yz/link-yz
/link-y/..)r   rF   r   r?   r"   r   r   rw   r   r   r   r   )r   r   r   r   Ú(test_realpath_resolve_before_normalizingÀ  s    
z6PosixPathTest.test_realpath_resolve_before_normalizingc          
   C   s¤   zzt  t¡ t  td ¡ t  ttd ¡ t ttƒ¡: ttƒ}|  t	|d ƒt¡ |  t	|d ƒtd ¡ W d Q R X W d t 
td ¡ ttd ƒ ttƒ X d S )Nz/kÚlinkzlink/k)r   rF   r   r?   r   rw   r   r   r"   r   r   r   )r   Úbaser   r   r   Útest_realpath_resolve_firstÝ  s    
&z)PosixPathTest.test_realpath_resolve_firstc             C   s¬  t jdd„  }t _zŠt j t  ¡ ¡d }|  ttjd¡ |  t d¡d¡ |  t t 	d¡¡d¡ |  t d¡d¡ |  t d¡d¡ |  t dd¡d	| d
 ¡ |  t dd¡d	| d ¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t d
d
¡d¡ |  t dd¡d¡ W d |t _X d S )Nc               S   s   dS )Nz/home/user/barr   r   r   r   r   Ú<lambda>ò  r)   z,PosixPathTest.test_relpath.<locals>.<lambda>éÿÿÿÿr   ru   za/bz../a/bz../bz../z/az../cz/a/bzb/cz../../ar2   z/foo/bar/batz/x/y/zz../../../foo/bar/batz/foo/barZbatr&   zfoo/bar/batz../../..z/xz../foo/bar/batz
../../../x)
r   rl   r/   r*   ÚassertRaisesÚ
ValueErrorr#   rq   r"   r   )r   Zreal_getcwdÚcurdirr   r   r   Útest_relpathñ  s.    zPosixPathTest.test_relpathc             C   sÐ  t jdd„  }t _z®t j t  ¡ ¡d }|  ttjd¡ |  t d¡d¡ |  t t 	d¡¡d¡ |  t d¡d¡ |  t d¡d¡ |  t dd¡d	| d
 ¡ |  t dd¡d	| d ¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t dd¡d¡ |  t d
d
¡d¡ |  t dd¡d¡ |  t
tjdd¡ |  t
tjdd¡ W d |t _X d S )Nc               S   s   dS )Ns   /home/user/barr   r   r   r   r   r„     r)   z2PosixPathTest.test_relpath_bytes.<locals>.<lambda>r…   r)   ó   as   a/bs   ../a/bs   ../bs   ../s   /as   ../cs   /a/bs   b/cs   ../../arh   s   /foo/bar/bats   /x/y/zs   ../../../foo/bar/bats   /foo/bars   batr(   s   foo/bar/bats   ../../..s   /xs   ../foo/bar/bats
   ../../../xs   bytesra   )r   rm   r/   r*   r†   r‡   r#   rq   r"   r   Ú	TypeError)r   Zreal_getcwdbrˆ   r   r   r   Útest_relpath_bytes  s4    z PosixPathTest.test_relpath_bytesc                s   ‡ fdd„}‡ fdd„}ˆ   ttjg ¡ |tddgƒ |tddgƒ |dgdƒ |ddgdƒ |ddgdƒ |ddgdƒ |d	d
gdƒ |ddgdƒ |ddgdƒ |ddgdƒ |ddgdƒ |ddgdƒ |ddgdƒ |ddgdƒ |dgdƒ |ddgdƒ |ddgdƒ |ddgdƒ |ddgdƒ |ddgdƒ |dddgdƒ |dddgdƒ |dgdƒ |ddgdƒ |tddgƒ ˆ   ttjd dg¡ ˆ   ttjd d!g¡ ˆ   ttjd"dg¡ ˆ   ttjdd#g¡ ˆ   ttjdd$g¡ ˆ   ttjd%d#g¡ d S )&Nc                s8   ˆ   t | ¡|¡ ˆ   t dd„ | D ƒ¡t |¡¡ d S )Nc             S   s   g | ]}t  |¡‘qS r   )r   Úfsencode)Ú.0Úpr   r   r   ú
<listcomp>,  s    z@PosixPathTest.test_commonpath.<locals>.check.<locals>.<listcomp>)r"   r#   Ú
commonpathr   r   )ÚpathsZexpected)r   r   r   Úcheck*  s    z,PosixPathTest.test_commonpath.<locals>.checkc                s.   ˆ   | tj|¡ ˆ   | tjdd„ |D ƒ¡ d S )Nc             S   s   g | ]}t  |¡‘qS r   )r   r   )rŽ   r   r   r   r   r   1  s    zFPosixPathTest.test_commonpath.<locals>.check_error.<locals>.<listcomp>)r†   r#   r‘   )Úexcr’   )r   r   r   Úcheck_error.  s    
z2PosixPathTest.test_commonpath.<locals>.check_errorz/usrZusrz
/usr/localz/usr/local/z/usr//localz//usr/localz/usr/./localz/./usr/localr&   z/devz	/usr/lib/z/usr/lib/python3z/usr/libz/usr/lib64/z
/usr/lib64ZspamZalotr   zand/jamzand/spamÚandzand//jamz
and/spam//z	and/./jamz
./and/spamz	spam/alotz
/spam/alots	   /usr/lib/zusr/lib/python3s   usr/lib/s   /usr/lib/python3s   usr/lib/python3zusr/lib/)r†   r‡   r#   r‘   r‹   )r   r“   r•   r   )r   r   Útest_commonpath)  sP    










zPosixPathTest.test_commonpath),Ú__name__Ú
__module__Ú__qualname__r   r   r%   r+   r1   r3   r6   r7   r8   rC   rE   rG   r   Z
skipUnlessr   r>   rH   ZskipIfrJ   rQ   rS   rU   r[   rg   rj   r   rn   ro   Úhasattrr   rp   rr   rx   ry   r~   r   r€   rƒ   r‰   rŒ   r—   r   r   r   r   r   $   sb   	
	'

	(r   c               @   s   e Zd ZeZddddgZdS )ÚPosixCommonTestrq   ÚsamefileÚsameopenfileÚsamestatN)r˜   r™   rš   r#   Z
pathmoduleZ
attributesr   r   r   r   rœ   `  s   rœ   c               @   s°   e Zd ZeZdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd „ Zd!d"„ Zd#d$„ Zd%d&„ Zd'd(„ Zd)S )*ÚPathLikeTestsc          	   C   sP   t j ¡ | _tt jƒ| _|  t j| j¡ t| jddƒ}| 	d¡ W d Q R X d S )NZxbr   s   test_posixpath.PathLikeTests)
r   r   ÚlowerÚ	file_namer   Ú	file_pathZ
addCleanupr   r<   r=   )r   Úfiler   r   r   r   i  s
    zPathLikeTests.setUpc             C   s   |   || jƒ|| jƒ¡ d S )N)r"   r£   r¢   )r   Úfuncr   r   r   ÚassertPathEqualp  s    zPathLikeTests.assertPathEqualc             C   s   |   | jj¡ d S )N)r¦   r/   Únormcase)r   r   r   r   Útest_path_normcases  s    z PathLikeTests.test_path_normcasec             C   s   |   | jj¡ d S )N)r¦   r/   r5   )r   r   r   r   Útest_path_isabsv  s    zPathLikeTests.test_path_isabsc             C   s,   |   | j dtdƒd¡| j ddd¡¡ d S )Nru   Úbrv   )r"   r/   r$   r   )r   r   r   r   Útest_path_joiny  s    zPathLikeTests.test_path_joinc             C   s   |   | jj¡ d S )N)r¦   r/   r*   )r   r   r   r   Útest_path_split}  s    zPathLikeTests.test_path_splitc             C   s   |   | jj¡ d S )N)r¦   r/   r-   )r   r   r   r   Útest_path_splitext€  s    z PathLikeTests.test_path_splitextc             C   s   |   | jj¡ d S )N)r¦   r/   Ú
splitdrive)r   r   r   r   Útest_path_splitdriveƒ  s    z"PathLikeTests.test_path_splitdrivec             C   s   |   | jj¡ d S )N)r¦   r/   r   )r   r   r   r   Útest_path_basename†  s    z PathLikeTests.test_path_basenamec             C   s   |   | jj¡ d S )N)r¦   r/   r   )r   r   r   r   Útest_path_dirname‰  s    zPathLikeTests.test_path_dirnamec             C   s   |   | jj¡ d S )N)r¦   r/   r:   )r   r   r   r   Útest_path_islinkŒ  s    zPathLikeTests.test_path_islinkc             C   s   |   | jj¡ d S )N)r¦   r/   r;   )r   r   r   r   Útest_path_lexists  s    zPathLikeTests.test_path_lexistsc             C   s   |   | jj¡ d S )N)r¦   r/   rD   )r   r   r   r   Útest_path_ismount’  s    zPathLikeTests.test_path_ismountc             C   s   |   | jj¡ d S )N)r¦   r/   rT   )r   r   r   r   Útest_path_expanduser•  s    z"PathLikeTests.test_path_expanduserc             C   s   |   | jj¡ d S )N)r¦   r/   Ú
expandvars)r   r   r   r   Útest_path_expandvars˜  s    z"PathLikeTests.test_path_expandvarsc             C   s   |   | jj¡ d S )N)r¦   r/   ri   )r   r   r   r   Útest_path_normpath›  s    z PathLikeTests.test_path_normpathc             C   s   |   | jj¡ d S )N)r¦   r/   r   )r   r   r   r   Útest_path_abspathž  s    zPathLikeTests.test_path_abspathc             C   s   |   | jj¡ d S )N)r¦   r/   r   )r   r   r   r   Útest_path_realpath¡  s    z PathLikeTests.test_path_realpathc             C   s   |   | jj¡ d S )N)r¦   r/   rq   )r   r   r   r   Útest_path_relpath¤  s    zPathLikeTests.test_path_relpathc             C   s&   | j  | j| jg¡}|  || j¡ d S )N)r/   r‘   r£   r¢   r"   )r   Zcommon_pathr   r   r   Útest_path_commonpath§  s    z"PathLikeTests.test_path_commonpathN)r˜   r™   rš   r#   r/   r   r¦   r¨   r©   r«   r¬   r­   r¯   r°   r±   r²   r³   r´   rµ   r·   r¸   r¹   rº   r»   r¼   r   r   r   r   r    e  s*   r    Ú__main__)r   r#   r   Úwarningsr   r   r   r   r   r   r   Ztest.supportr   r	   rJ   ÚImportErrorr   r   r   r   ZTestCaser   Z
CommonTestrœ   r    r˜   Úmainr   r   r   r   Ú<module>   s.   


    @G