Your IP : 216.73.216.60


Current Path : /opt/alt/python39/lib64/python3.9/test/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/test/__pycache__/test_posixpath.cpython-39.pyc

a

XC?h��@sddlZddlZddlZddlZddlmZddlmZmZmZm	Z	m
Z
ddlmZddlmZm
Z
ddlmZddlmZzddlZWney�dZYn0eej�Zdd	�Zd
d�Zdd
�ZGdd�dej�ZGdd�de
jej�ZGdd�dej�Zedk�re��dS)�N)�partial)�realpath�abspath�dirname�basename�
ALLOW_MISSING)�support)r�test_genericpath)�FakePath)�mockcCs"dtv}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)�testZfound_backslash�msg�r�8/opt/alt/python39/lib64/python3.9/test/test_posixpath.py�!skip_if_ABSTFN_contains_backslashsrcCs&zt�|�Wnty Yn0dS�N)�os�rmdir�OSError)rrrr�
safe_rmdir!srcs�fdd�}|S)a{Simplistic decorator to parametrize a test

    Runs the decorated test multiple times in subTest, with a value from
    'parameters' passed as an extra positional argument.
    Does *not* call doCleanups() after each run.

    Not for general use. Intended to avoid indenting for easier backports.

    See https://discuss.python.org/t/91827 for discussing generalizations.
    cs��fdd�}|S)Nc	sR�D]H}|�|��*�|g|�|�Ri|��Wd�q1sB0YqdSr)�subTest)�self�args�kwargsZ	parameter)�func�
parametersrr�_parameterized3szE_parameterize.<locals>._parametrize_decorator.<locals>._parameterizedr)rr �r)rr�_parametrize_decorator2sz-_parameterize.<locals>._parametrize_decoratorr)rr"rr!r�
_parameterize'sr#c@sheZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Ze�e��d�dd��Ze�edud�dd��Ze�edud�d d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zeeid*d+id*ei�d,d-���Zeeid*d+id*ei�d.d/���Z e�e!e"d0�d1�eeid*ei�d2d3����Z#e�e!e"d0�d1�ed4d5���Z$d6d7�Z%e�e!e"d0�d1�eeid*ei�d8d9����Z&e�e!e"d0�d1�eeid*ei�d:d;����Z'ej(ed<d=���Z)e�e!e"d0�d1�eed*d+id*ei�d>d?����Z*e�e!e"d0�d1�eeid*d+id*ei�d@dA����Z+e�e!e"d0�d1�eeid*d+id*ei�dBdC����Z,e�e!e"d0�d1�eeid*ei�dDdE����Z-e�e!e"d0�d1�eeid*d+id*ei�dFdG����Z.e�e!e"d0�d1�eeid*d+id*ei�dHdI����Z/ej(ee�e"j0e"j1vdJ�e�e2j3dKkdL�ed*d+id*ei�dMdN������Z4eej(dOdP���Z5dQdR�Z6dSdT�Z7dUdV�Z8dS)W�
PosixPathTestcCs|��dSr)�tearDown�rrrr�setUp=szPosixPathTest.setUpcCs,dD]"}t�tj|�ttj|�qdS)N)��1�2)r�unlink�TESTFNr)r�suffixrrrr%@szPosixPathTest.tearDowncCs�|�t�dddd�d�|�t�ddd�d�|�t�ddd	�d
�|�t�ddd
d�d�|�t�ddd�d�|�t�ddd�d�dS)N�/foo�barz/barZbazz/bar/bazz/foo/bar/bazz/foo/zbar/zbaz/z
/foo/bar/baz/�/foo�bars/barsbazs/bar/bazs/foo/bar/bazs/foo/sbar/sbaz/s
/foo/bar/baz/)�assertEqual�	posixpath�joinr&rrr�	test_joinEs �����zPosixPathTest.test_joincCs�|�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�dS)N�/foo/bar)r.r/�/)r7r(�foo)r(r8�////foo)�////r8�
//foo//bar)�//foor/�/foo/bar)r0r1�/)r>��foo)r?r@�////foo)�////r@�
//foo//bar)�//foor1)r2r3�splitr&rrr�
test_splitSszPosixPathTest.test_splitcCs�|�t�|�||f�|�t�d|�d||f�|�t�d|�d||f�|�t�d|�d||f�|�t�d|�d||f�|�t�|d�||ddf�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�||ddf�dS)Nr7zabc/zabc.def/z	/abc.def/r(�ASCIIr>sabc/sabc.def/s	/abc.def/r?)r2r3�splitext�bytes)r�path�filenameZextrrr�splitextTest`sB
�
�
��



�
�
�
��zPosixPathTest.splitextTestcCs�|�ddd�|�ddd�|�ddd�|�dd	d
�|�ddd�|�d
d
d�|�ddd�|�ddd�|�ddd�|�ddd�|�ddd�|�ddd�dS)Nzfoo.barr8z.barzfoo.boo.barzfoo.boozfoo.boo.biff.barzfoo.boo.biffz.csh.rcz.cshz.rcZnodotsr(z.cshrcz...manydotsz...manydots.extz.ext�.�..z........)rLr&rrr�
test_splitext|szPosixPathTest.test_splitextcCs�|�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�dS)
Nr(Fr7Tr.r6zfoo/barr?r>r0r=sfoo/bar)�assertIsr3�isabsr&rrr�
test_isabs�szPosixPathTest.test_isabscCs�|�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	�dS)Nr6r/r7r(r8r9r;r=r1r>r?r@rArC)r2r3rr&rrr�
test_basename�szPosixPathTest.test_basenamecCs�|�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�dS)Nr6r.r7r8r(r9r:r;r<r=r0r>r@r?rArBrCrD)r2r3rr&rrr�test_dirname�szPosixPathTest.test_dirnamecCs�|�t�tjd�d�|�t�tjd�d�ttjdd��}|�d�Wd�n1s`0Y|�t�tjd�d�t���rt	�
tjdtjd�|�t�tjd�d�t	�tjd�|�t�tjd�d�|�t�tjd�d�|�t�tjd�d�|�t�tjd�d�|�t�t	�
tj�d�d�|�t�tjd	�d�|�t�t	�
tj�d
�d�dS)Nr)Fr*�wbr@Tu�����)rPr3�islinkrr,�lexists�open�write�can_symlinkr�symlink�remove�exists�fsencode)r�frrr�test_islink�s (
zPosixPathTest.test_islinkcCs(|�t�d�d�|�t�d�d�dS)Nr7Tr>)rPr3�ismountr&rrr�test_ismount�szPosixPathTest.test_ismountcCs�|�t�t�d�z(t�t�|�t�t�d�Wtt�n
tt�0|�t�d�d�|�t�d�d�|�t�d�d�|�t�d�d�dS)NF�/��/��/�/)rPr3rdr
r�mkdirrr&rrr�test_ismount_non_existent�s
z'PosixPathTest.test_ismount_non_existentzTest requires symlink supportc	Cs>z,t�dt�|�t�t�d�Wt�t�nt�t�0dS)Nr7F)rr^r
rPr3rdr+r&rrr�test_ismount_symlinks�sz#PosixPathTest.test_ismount_symlinksNzTest requires posix modulecCs>tj}dd�}z"|t_|�t�t�d�W|t_n|t_0dS)NcSs6d}d}|tkrd}d}t�d||dddddddf
�S)Nr�)r
�posix�stat_result�rJ�st_ino�st_devrrr�
fake_lstat�sz?PosixPathTest.test_ismount_different_device.<locals>.fake_lstatT�r�lstatrPr3rdr
�rZ
save_lstatrsrrr�test_ismount_different_device�sz+PosixPathTest.test_ismount_different_devicecCs>tj}dd�}z"|t_|�t�t�d�W|t_n|t_0dS)NcSsPd}d}|�t�r"|tkr"td��|tkr2d}d}t�d||dddddddf
�S)Nrz!Fake [Errno 13] Permission deniedrm)�
startswithr
rrnrorprrrrs�szEPosixPathTest.test_ismount_directory_not_readable.<locals>.fake_lstatTrtrvrrr�#test_ismount_directory_not_readable�sz1PosixPathTest.test_ismount_directory_not_readablecCs(|�t�d�d�|�t�d�d�dS)Nr8r@)r2r3�
expanduserr&rrr�test_expanduser
szPosixPathTest.test_expanduserc
Cs�t����}d|d<|�t�d�d�d|d<|�t�d�d�dD]n}|j|d��N||d<|�t�d�d�|�t�d�d�|�t�d	�d
�Wd�qB1s�0YqBWd�n1s�0YdS)Nz/home/victor�HOME�~z
/home/victor/)r7r(�//�///)�homer7�~/z~/foor.)r�EnvironmentVarGuardr2r3rzr)r�envr�rrr�test_expanduser_home_envvars
z)PosixPathTest.test_expanduser_home_envvarc
Cs�t�d�}|�t�d�t�|�t�d�t�t�d�dkrt|�t�d�dt�d��|�t�d�dt�d��|�t�d�t�|�t�d	�t�|�t�d
�t�|�t�d�t�t����}|d=|�	t
���j}|�
d�p�d}|�t�d�|�tjj|d
td��btjj|dtd��.dD]}|�t�|�|��q(Wd�n1�sX0YWd�n1�sx0YWd�n1�s�0YdS)N�pwdr�s~/r}r7�~r>z~root/z~foo/s~root/s~foo/r|�getpwuid)Zside_effect�getpwnam)r}z~/.localz
~vstinner/)r�
import_moduleZassertIsInstancer3rz�strrIr2r�r�r�getuid�pw_dir�rstriprZpatch�object�KeyError)rr�r�r�rJrrr�test_expanduser_pwds4
��
�z!PosixPathTest.test_expanduser_pwdcCs|�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�dS)Nr(rMr7r~rz///foo/.//bar//r6z///foo/.//bar//.//..//.//bazz/foo/bazz///..//./foo/.//barr?�.r>s//s///s///foo/.//bar//r=s///foo/.//bar//.//..//.//bazs/foo/bazs///..//./foo/.//bar)r2r3�normpathr&rrr�
test_normpathEs(���zPosixPathTest.test_normpath�strictTcCs�|�tdi|��t���|�td	i|��t���|�td�dgd�fi|��t���|�td
i|��t���|�tdi|��t���|�td�dgd�fi|��t���dS)NrM�./.r7�dr��./.r>)rM)r�)r�)r�)r2rr�getcwdr4�getcwdb�rrrrr�test_realpath_curdirYs(z"PosixPathTest.test_realpath_curdircCs�|�tdi|��tt����|�td	i|��ttt�����|�td�dgd�fi|��d�|�td
i|��tt����|�tdi|��ttt�����|�td�dgd�fi|��d�dS)NrN�../..r7r��..�../..r>)rN)r�)r�)r�)r2rrrr�r4r�r�rrr�test_realpath_pardirds"$"z"PosixPathTest.test_realpath_pardirr^zMissing symlink implementationc	CsLz:t�tdt�|�ttfi|��td�Wt�t�nt�t�0dS�Nr))rr^r
r2rrr+r�rrr�test_realpath_basicosz!PosixPathTest.test_realpath_basicc	CsXzFt�tdt�|jtttdd�|jtttddd�Wt�t�nt�t�0dS)Nr)T�r�r*)rr^r
�assertRaises�FileNotFoundErrorrrr+r&rrr�test_realpath_strict{s
z"PosixPathTest.test_realpath_strictcCs�d}|jtt|dd�|jtt|dd�|jtt|td�d}|jtt|dd�|jtt|dd�|jtt|td�d}|jtt|dd�|jtt|dd�|jtt|td�d}|jtt|dd�|jtt|dd�|jtt|td�d}|jtt|dd�|jtt|dd�|jtt|td�d	}|jtt|dd�|jtt|dd�|jtt|td�d
}|jtt|dd�|jtt|dd�|jtt|td�d}|jtt|dd�|jtt|dd�|jtt|td�d}tjd
k�r|�t|dd�|�|jtt|dd�|�t|td�|�n6|jtt|dd�|jtt|dd�|jtt|td�d}tjd
k�r�|�t|dd�|�|�t|td�|�n$|jtt|dd�|jtt|td�|jtt|dd�d}tjd
k�r|�t|dd�d�|jtt|dd�|�t|td�d�n6|jtt|dd�|jtt|dd�|jtt|td�d}tjd
k�r~|�t|dd�d�|�t|td�d�n$|jtt|dd�|jtt|td�|jtt|dd�d}tjd
k�r�|jt	t|dd�|jt	t|dd�|jt	t|td�n:|�t|dd�|�|jtt|dd�|�t|td�|�d}tjd
k�rl|jt	t|dd�|jt	t|td�n|�t|dd�|�|jtt|dd�dS)NrhFr�Triz/nonexistent/xs/nonexistent/xz//..s//..z/nonexistent/x/..s/nonexistent/x/..rfZwin32u/nonexistent/�u/�/..r7u/nonexistent/�/..z/nonexistentrgs/nonexistent/�)
r��
ValueErrorrrr��sys�platformr2�UnicodeEncodeError�UnicodeDecodeError)rrJrrr�test_realpath_invalid_paths�s�z)PosixPathTest.test_realpath_invalid_pathsc	CsRz@t�t�td�t�|�ttfi|��td�Wt�t�nt�t�0dSr�)	rr^r3�relpathr
r2rrr+r�rrr�test_realpath_relative�sz$PosixPathTest.test_realpath_relativec	CsZzFt�tjdtj�|�tdtjfi|��td�Wt�tj�nt�tj�0dS)Nr)znonexistent/../)rr^rr,r2rr
r+r�rrr�test_realpath_missing_pardir�s�z*PosixPathTest.test_realpath_missing_pardirc
Cs��z(t�tt�|�tt�t�t�tdtd�t�tdtd�|�ttd�td�|�ttd�td�|�ttd�td�|�ttd�tt��|�ttd�tt�d�t�tdtd�|�ttd	tt�d�td�|�ttd	tt�d�td�t�tt�d
td�|�ttd�td
�t�dttt��d
tt�dtd�|�ttd�td�t�tt���$|�ttt��t�Wd�n1�s�0YWt�	t�t�	td�t�	td�t�	td�t�	td�t�	td�nRt�	t�t�	td�t�	td�t�	td�t�	td�t�	td�0dS)Nr)r*�1/x�1/..�1/../x�/x�x�y�1/../�a/b�a�../r7�c)
rr^r
r2rrrr�
change_cwdr+r&rrr�test_realpath_symlink_loops�sR�����6
�
z)PosixPathTest.test_realpath_symlink_loopsc
Cs��zBt�tt�|jtttfi|��t�tdtd�t�tdtd�|jtttdfi|��|jtttdfi|��|jtttdfi|��|jtttdfi|��|jtttdfi|��t�tdtd�|jtttdtt�dfi|��|jtttdtt�dfi|��t�tt�d	td
�|jtttd
fi|��t�dttt��dtt�d
td
�|jtttd
fi|��t�	tt���*|jtttt�fi|��Wd�n1�s�0YWt�
t�t�
td�t�
td�t�
td�t�
td
�t�
td
�nRt�
t�t�
td�t�
td�t�
td�t�
td
�t�
td
�0dS)Nr)r*r�r�r�r�r�r�r�r�r�r7r�)rr^r
r�rrrrrr�r+r�rrr�"test_realpath_symlink_loops_strictsZ�������<
�
z0PosixPathTest.test_realpath_symlink_loops_strictc
Cs�zvt�t�t�dtt�td�t�dtd�|�ttdfi|��t�Wt�td�t�td�t	t�n&t�td�t�td�t	t�0dS)Nr�z/selfzself/self/selfz/link)
rrjr
r^rr2rrr+rr�rrr�(test_realpath_repeated_indirect_symlinksJs

�z6PosixPathTest.test_realpath_repeated_indirect_symlinkscCsd}z�t�t�t|�D],}t�d�d|gd�td|d�qt�dtd�|�ttd|fi|��t�t�	t��$|�td|�t�Wd�n1s�0YWt|d�D]}t�
td|�q�tt�n.t|d�D]}t�
td|�q�tt�0dS)N�
r7z%dz/%drmrMz/0)rrjr
�ranger^r4r2rrr�r+r)rrZdepth�irrr�test_realpath_deep_recursionZs
* 4
�z*PosixPathTest.test_realpath_deep_recursionc
Cs�z�t�t�t�td�t�tdtd�t�td��*|�tdi|��td�Wd�n1sl0YWt�td�t	td�t	t�n$t�td�t	td�t	t�0dS)Nz/y�/kr�z/y/a)r�)
rrjr
r^rr�r2rr+rr�rrr�test_realpath_resolve_parentsos	
�$
�z+PosixPathTest.test_realpath_resolve_parentsc
Csz�t�t�t�td�t�td�t�tdtd�|�ttdfi|��td�t�tt���4|�tt	t�dfi|��td�Wd�n1s�0YWt�
td�ttd�ttd�tt�n0t�
td�ttd�ttd�tt�0dS)Nr�z/k/yz/link-yz
/link-y/..)rrjr
r^r2rrr�rrr+rr�rrr�(test_realpath_resolve_before_normalizing�s$
 �$
�z6PosixPathTest.test_realpath_resolve_before_normalizingc
Cs�z�t�t�t�td�t�ttd�t�tt���Ttt�}|�t	|dfi|��t�|�t	|dfi|��td�Wd�n1s�0YWt�
td�ttd�tt�n$t�
td�ttd�tt�0dS)Nr��linkzlink/k)rrjr
r^rr�rrr2rr+r)rr�baserrr�test_realpath_resolve_first�s
@
�z)PosixPathTest.test_realpath_resolve_firstzCan't set symlink permissions�darwinz1only macOS requires read permission to readlink()cCsZ�z6t�tdt�tjtddd�|�t�� ttfi|��Wd�n1sT0Y|�t��&ttdfi|��fWd�n1s�0Y|�t��$ttdfi|��Wd�n1s�0Y|�t��$ttdfi|��Wd�n1�s0YWtjtddd�t�t�ntjtddd�t�t�0dS)	Nr)rF)�follow_symlinksr.z/../fooz/foo/..��)rr^r
�chmodr��PermissionErrorrr+r�rrr�'test_realpath_unreadable_symlink_strict�s.426�z5PosixPathTest.test_realpath_unreadable_symlink_strictc
Csj�z@t�t�t�td�t�td�|�ttdd�t�|�ttdd�t�|�tttd�t�zt�t�Wnty�Yn0|�	d�|�ttddd�td�|j
tttddd�|j
tttdtd�|�ttddd�td�|j
tttddd�|j
tttdtd�Wt�td�ttd�tt�n"t�td�ttd�tt�0dS)	Nr�rFr�TzCannot block permissionsz/missingr�)rrjr
r�r2rr�statr�ZskipTestr�rr&rrr�"test_realpath_unreadable_directory�sH

������
�z0PosixPathTest.test_realpath_unreadable_directorycCs�tjdd�}t_�z�tj�t���d}|�ttjd�|�t�d�d�|�t�t�	d��d�|�t�d�d�|�t�d�d�|�t�dd�d	|d
�|�t�dd�d	|d�|�t�dd
�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�d
d
�d�|�t�dd�d�W|t_n|t_0dS)NcSsdS)Nz/home/user/barrrrrr�<lambda>�r?z,PosixPathTest.test_relpath.<locals>.<lambda>���r(r�r�z../a/bz../br�z/az../cz/a/bzb/cz../../arMz/foo/bar/batz/x/y/zz../../../foo/bar/batr6Zbatr7zfoo/bar/batz../../..r�z../foo/bar/batz
../../../x)
rr�rJrEr�r�r3r�r2r)rZreal_getcwd�curdirrrr�test_relpath�s0
�zPosixPathTest.test_relpathcCs�tjdd�}t_�z�tj�t���d}|�ttjd�|�t�d�d�|�t�t�	d��d�|�t�d�d�|�t�d�d�|�t�dd�d	|d
�|�t�dd�d	|d�|�t�dd
�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�dd�d�|�t�d
d
�d�|�t�dd�d�|�t
tjdd�|�t
tjdd�W|t_n|t_0dS)NcSsdS)Ns/home/user/barrrrrrr�r?z2PosixPathTest.test_relpath_bytes.<locals>.<lambda>r�r?�asa/bs../a/bs../bs../s/as../cs/a/bsb/cs../../ar�s/foo/bar/bats/x/y/zs../../../foo/bar/batr=sbatr>sfoo/bar/bats../../..s/xs../foo/bar/bats
../../../xsbytesr�)rr�rJrEr�r�r3r�r2r�	TypeError)rZreal_getcwdbr�rrr�test_relpath_bytess8
�
�z PosixPathTest.test_relpath_bytescs��fdd�}�fdd�}��ttjg�|tddg�|tddg�|dgd�|ddgd�|ddgd�|ddgd�|d	d
gd�|ddgd�|d
dgd
�|ddgd
�|ddgd�|ddgd�|ddgd�|ddgd�|dgd�|ddgd�|ddgd�|ddgd�|ddgd�|ddgd�|gd�d�|gd�d�|dgd�|dd gd�|tdd!g���ttjd"dg���ttjd"d#g���ttjd$dg���ttjdd%g���ttjdd&g���ttjd'd%g�dS)(Ncs8��t�|�|���t�dd�|D��t�|��dS)NcSsg|]}t�|��qSr�rra��.0�prrr�
<listcomp>,r?z@PosixPathTest.test_commonpath.<locals>.check.<locals>.<listcomp>)r2r3�
commonpathrra)�pathsZexpectedr&rr�check*s�z,PosixPathTest.test_commonpath.<locals>.checkcs.��|tj|���|tjdd�|D��dS)NcSsg|]}t�|��qSrr�r�rrrr�1r?zFPosixPathTest.test_commonpath.<locals>.check_error.<locals>.<listcomp>)r�r3r�)�excr�r&rr�check_error.s
�z2PosixPathTest.test_commonpath.<locals>.check_errorz/usrZusrz
/usr/localz/usr/local/z/usr//localz//usr/localz/usr/./localz/./usr/localr7z/devz	/usr/lib/z/usr/lib/python3z/usr/libz/usr/lib64/z
/usr/lib64Zspam�alotr(�and/jam�and/spam�andzand//jamz
and/spam//z	and/./jamz
./and/spam)r�r�r�)r�r�r�z	spam/alotz
/spam/alots	/usr/lib/zusr/lib/python3susr/lib/s/usr/lib/python3susr/lib/python3zusr/lib/)r�r�r3r�r�)rr�r�rr&r�test_commonpath)s\
�
�
�
�
�
�zPosixPathTest.test_commonpath)9�__name__�
__module__�__qualname__r'r%r5rFrLrOrRrSrTrcrerkrZ
skipUnlessrr]rlZskipIfrnrwryr{r�r�r�rr#rr�r��hasattrrr�r�r�r�r�Zskip_unless_symlinkr�r�r�r�r�r�r�r��supports_follow_symlinksr�r�r�r�r�r�r�rrrrr$;s�




�


'		��
W��'�'�����"r$c@seZdZeZgd�ZdS)�PosixCommonTest)r��samefile�sameopenfile�samestatN)r�r�r�r3Z
pathmoduleZ
attributesrrrrr�`sr�c@s�eZdZeZdd�Zdd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zeid#d$id#ei�d%d&��Zd'd(�Zd)d*�Zd+S),�
PathLikeTestscCs`tj|_ttj�|_|�tj|j�t|jdd��}|�d�Wd�n1sR0YdS)NZxbrstest_posixpath.PathLikeTests)	rr,�	file_namer
�	file_pathZ
addCleanupr+r[r\)r�filerrrr'is
zPathLikeTests.setUpcCs|�||j�||j��dSr)r2r�r�)rrrrr�assertPathEqualpszPathLikeTests.assertPathEqualcCs|�|jj�dSr)r�rJ�normcaser&rrr�test_path_normcasessz PathLikeTests.test_path_normcasecCs|�|jj�dSr)r�rJrQr&rrr�test_path_isabsvszPathLikeTests.test_path_isabscCs,|�|j�dtd�d�|j�ddd��dS)Nr��br�)r2rJr4r
r&rrr�test_path_joinys�zPathLikeTests.test_path_joincCs|�|jj�dSr)r�rJrEr&rrr�test_path_split}szPathLikeTests.test_path_splitcCs|�|jj�dSr)r�rJrHr&rrr�test_path_splitext�sz PathLikeTests.test_path_splitextcCs|�|jj�dSr)r�rJ�
splitdriver&rrr�test_path_splitdrive�sz"PathLikeTests.test_path_splitdrivecCs|�|jj�dSr)r�rJrr&rrr�test_path_basename�sz PathLikeTests.test_path_basenamecCs|�|jj�dSr)r�rJrr&rrr�test_path_dirname�szPathLikeTests.test_path_dirnamecCs|�|jj�dSr)r�rJrYr&rrr�test_path_islink�szPathLikeTests.test_path_islinkcCs|�|jj�dSr)r�rJrZr&rrr�test_path_lexists�szPathLikeTests.test_path_lexistscCs|�|jj�dSr)r�rJrdr&rrr�test_path_ismount�szPathLikeTests.test_path_ismountcCs|�|jj�dSr)r�rJrzr&rrr�test_path_expanduser�sz"PathLikeTests.test_path_expandusercCs|�|jj�dSr)r�rJ�
expandvarsr&rrr�test_path_expandvars�sz"PathLikeTests.test_path_expandvarscCs|�|jj�dSr)r�rJr�r&rrr�test_path_normpath�sz PathLikeTests.test_path_normpathcCs|�|jj�dSr)r�rJrr&rrr�test_path_abspath�szPathLikeTests.test_path_abspathr�TcCs,|�|jj�|�t|jjfi|���dSr)r�rJrrr�rrr�test_path_realpath�sz PathLikeTests.test_path_realpathcCs|�|jj�dSr)r�rJr�r&rrr�test_path_relpath�szPathLikeTests.test_path_relpathcCs&|j�|j|jg�}|�||j�dSr)rJr�r�r�r2)rZcommon_pathrrr�test_path_commonpath�sz"PathLikeTests.test_path_commonpathN)r�r�r�r3rJr'r�r�r�r�r�r�r�r�r�r�rrrrrrr#rrrr	rrrrr�es,
r��__main__)rr�r3r�	functoolsrrrrrrrrr	Ztest.supportr
rrn�ImportErrorr,r
rrr#ZTestCaser$Z
CommonTestr�r�r��mainrrrr�<module>s8


+J