Your IP : 216.73.216.196


Current Path : /opt/alt/python310/lib64/python3.10/test/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/test/__pycache__/test_posixpath.cpython-310.pyc

o

0�i���@s(ddlZddlZddlZddlZddlmZddlmZmZmZm	Z	m
Z
ddlmZddlm
Z
ddlmZddlmZddlmZdd	lmZzddlZWneyYdZYnweej�Zd
d�Zdd
�Zdd�ZGdd�dej�ZGdd�de
jej�ZGdd�dej�Ze dkr�e�!�dSdS)�N)�partial)�realpath�abspath�dirname�basename�
ALLOW_MISSING)�support)�test_genericpath)�
import_helper)�	os_helper)�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�:/opt/alt/python310/lib64/python3.10/test/test_posixpath.py�!skip_if_ABSTFN_contains_backslashsrcCs&zt�|�WdStyYdSw�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]$}|�|���|g|�|�Ri|��Wd�n1s!wYqdSr)�subTest)�self�args�kwargsZ	parameter)�func�
parametersrr�_parameterized5s���zE_parameterize.<locals>._parametrize_decorator.<locals>._parameterizedr)r r"�r!)r r�_parametrize_decorator4sz-_parameterize.<locals>._parametrize_decoratorr)r!r$rr#r�
_parameterize)sr%c@szeZdZdd�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%�Ze�ejd&kd'�d(d)��Zd*d+�Zeeid,d-id,e i�d.d/���Z!eeid,d-id,e i�d0d1���Z"e�e#e$d2�d3�eeid,e i�d4d5����Z%e�e#e$d2�d3�ed6d7���Z&d8d9�Z'e�e#e$d2�d3�eeid,e i�d:d;����Z(e�e#e$d2�d3�eeid,e i�d<d=����Z)ej*ed>d?���Z+e�e#e$d2�d3�eed,d-id,e i�d@dA����Z,e�e#e$d2�d3�eeid,d-id,e i�dBdC����Z-e�e#e$d2�d3�eeid,d-id,e i�dDdE����Z.e�e#e$d2�d3�eeid,e i�dFdG����Z/e�e#e$d2�d3�eeid,d-id,e i�dHdI����Z0e�e#e$d2�d3�eeid,d-id,e i�dJdK����Z1ej*ee�e$j2e$j3vdL�e�ejdMkdN�ed,d-id,e i�dOdP������Z4eej*dQdR���Z5dSdT�Z6dUdV�Z7dWdX�Z8dS)Y�
PosixPathTestcCs|��dSr)�tearDown�rrrr�setUp?szPosixPathTest.setUpcCs,dD]}t�tj|�ttj|�qdS)N)��1�2)r�unlink�TESTFNr)r�suffixrrrr'Bs�zPosixPathTest.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_joinGs �����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)r0r1�/)r9r*�foo)r*r:�////foo)�////r:�
//foo//bar)�//foor1�/foo/bar)r2r3�/)r@��foo)rArB�////foo)�////rB�
//foo//bar)�//foor3)r4r5�splitr(rrr�
test_splitU�zPosixPathTest.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)Nr9zabc/zabc.def/z	/abc.def/r*�ASCIIr@sabc/sabc.def/s	/abc.def/rA)r4r5�splitext�bytes)r�path�filenameZextrrr�splitextTestbsB
�
�
��



�
�
�
��zPosixPathTest.splitextTestcCs�|�ddd�|�ddd�|�ddd�|�dd	d
�|�ddd�|�d
d
d�|�ddd�|�ddd�|�ddd�|�ddd�|�ddd�|�ddd�dS)Nzfoo.barr:z.barzfoo.boo.barzfoo.boozfoo.boo.biff.barzfoo.boo.biffz.csh.rcz.cshz.rcZnodotsr*z.cshrcz...manydotsz...manydots.extz.ext�.�..z........)rOr(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*Fr9Tr0r8zfoo/barrAr@r2r?sfoo/bar)�assertIsr5�isabsr(rrr�
test_isabs�rIzPosixPathTest.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)Nr8r1r9r*r:r;r=r?r3r@rArBrCrE)r4r5rr(rrr�
test_basename�rIzPosixPathTest.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)Nr8r0r9r:r*r;r<r=r>r?r2r@rBrArCrDrErF)r4r5rr(rrr�test_dirname�rIzPosixPathTest.test_dirnamecCs�|�t�tjd�d�|�t�tjd�d�ttjdd��
}|�d�Wd�n1s0wY|�t�tjd�d�t��r�t	�
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,�wbrBTu�����)rSr5�islinkrr.�lexists�open�write�can_symlinkr�symlink�remove�exists�fsencode)r�frrr�test_islink�s"�"zPosixPathTest.test_islinkcCsT|�t�d�d�|�t�d�d�|�t�td��d�|�t�td��d�dS)Nr9Tr@)rSr5�ismountrr(rrr�test_ismount�szPosixPathTest.test_ismountcCs�|�t�t�d�zt�t�|�t�t�d�Wtt�ntt�w|�t�d�d�|�t�d�d�|�t�d�d�|�t�d�d�dS)NF�/��/��/�/)rSr5rgrr�mkdirrr(rrr�test_ismount_non_existent�s
z'PosixPathTest.test_ismount_non_existentzTest requires symlink supportc	Cs<zt�dt�|�t�t�d�Wt�t�dSt�t�w)Nr9F)rrarrSr5rgr-r(rrr�test_ismount_symlinks�sz#PosixPathTest.test_ismount_symlinksNzTest requires posix modulecC�<tj}dd�}z|t_|�t�t�d�W|t_dS|t_w)NcSs6d}d}|tkrd}d}t�d||dddddddf
�S)Nr�)r�posix�stat_result�rM�st_ino�st_devrrr�
fake_lstat�sz?PosixPathTest.test_ismount_different_device.<locals>.fake_lstatT�r�lstatrSr5rgr�rZ
save_lstatrwrrr�test_ismount_different_device�sz+PosixPathTest.test_ismount_different_devicecCrp)NcSsPd}d}|�t�r|tkrtd��|tkrd}d}t�d||dddddddf
�S)Nrz!Fake [Errno 13] Permission deniedrq)�
startswithrrrrrsrtrrrrw�szEPosixPathTest.test_ismount_directory_not_readable.<locals>.fake_lstatTrxrzrrr�#test_ismount_directory_not_readable�sz1PosixPathTest.test_ismount_directory_not_readablecCs(|�t�d�d�|�t�d�d�dS)Nr:rB)r4r5�
expanduserr(rrr�test_expanduserszPosixPathTest.test_expanduserc
Cs�t���]}d|d<|�t�d�d�d|d<|�t�d�d�dD]7}|j|d��'||d<|�t�d�d�|�t�d�d�|�t�d	�d
�Wd�n1sSwYq!Wd�dS1sdwYdS)Nz/home/victor�HOME�~z
/home/victor/)r9r*�//�///)�homer9�~/z~/foor0)r�EnvironmentVarGuardr4r5r~r)r�envr�rrr�test_expanduser_home_envvars
���"�z)PosixPathTest.test_expanduser_home_envvar�vxworkszno home directory on VxWorksc
Cs�t�d�}|�t�d�t�|�t�d�t�t�d�dkr:|�t�d�dt�d��|�t�d�dt�d��|�t�d�t�|�t�d	�t�|�t�d
�t�|�t�d�t�t�	��l}|d=|�
t���j
}|�d�ptd}|�t�d�|�tjj|d
td��/tjj|dtd��dD]}|�t�|�|�q�Wd�n1s�wYWd�n1s�wYWd�dSWd�dS1s�wYdS)N�pwdr�s~/r�r9�~r@z~root/z~foo/s~root/s~foo/r��getpwuid)Zside_effect�getpwnam)r�z~/.localz
~vstinner/)r
�
import_moduleZassertIsInstancer5r~�strrLr4rr�r�r�getuid�pw_dir�rstripr
Zpatch�object�KeyError)rr�r�r�rMrrr�test_expanduser_pwd"sB
��
�����
"�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*rPr9r�r�z///foo/.//bar//r8z///foo/.//bar//.//..//.//bazz/foo/bazz///..//./foo/.//barrA�.r@s//s///s///foo/.//bar//r?s///foo/.//bar//.//..//.//bazs/foo/bazs///..//./foo/.//bar)r4r5�normpathr(rrr�
test_normpathKs(���zPosixPathTest.test_normpath�strictTcCs�|�tdi|��t���|�td	i|��t���|�td�dgd�fi|��t���|�td
i|��t���|�tdi|��t���|�td�dgd�fi|��t���dS)NrP�./.r9�dr��./.r@)rP)r�)r�)r�)r4rr�getcwdr6�getcwdb�rrrrr�test_realpath_curdir_s(,z"PosixPathTest.test_realpath_curdircCs�|�tdi|��tt����|�td	i|��ttt�����|�td�dgd�fi|��d�|�td
i|��tt����|�tdi|��ttt�����|�td�dgd�fi|��d�dS)NrQ�../..r9r��..�../..r@)rQ)r�)r�)r�)r4rrrr�r6r�r�rrr�test_realpath_pardirjs"$"(z"PosixPathTest.test_realpath_pardirrazMissing symlink implementationc	CsJzt�tdt�|�ttfi|��td�Wt�t�dSt�t�w�Nr+)rrarr4rrr-r�rrr�test_realpath_basicusz!PosixPathTest.test_realpath_basicc	CsVz$t�tdt�|jtttdd�|jtttddd�Wt�t�dSt�t�w)Nr+T�r�r,)rrar�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�|�n|jtt|dd�|jtt|dd�|jtt|td�d}tjd
k�rF|�t|dd�|�|�t|td�|�n|jtt|dd�|jtt|td�|jtt|dd�d}tjd
k�r�|�t|dd�d�|jtt|dd�|�t|td�d�n|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�r6|jt	t|dd�|jt	t|td�n
|�t|dd�|�|jtt|dd�dS)NrkFr�Trlz/nonexistent/xs/nonexistent/xz//..s//..z/nonexistent/x/..s/nonexistent/x/..riZwin32u/nonexistent/�u/�/..r9u/nonexistent/�/..z/nonexistentrjs/nonexistent/�)
r��
ValueErrorrrr��sys�platformr4�UnicodeEncodeError�UnicodeDecodeError)rrMrrr�test_realpath_invalid_paths�s�z)PosixPathTest.test_realpath_invalid_pathsc	CsPz!t�t�td�t�|�ttfi|��td�Wt�t�dSt�t�wr�)	rrar5�relpathrr4rrr-r�rrr�test_realpath_relative�sz$PosixPathTest.test_realpath_relativec	CsXz$t�tjdtj�|�tdtjfi|��td�Wt�tj�dSt�tj�w)Nr+znonexistent/../)rrarr.r4rrr-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�n31s�wYWt�	t�t�	td�t�	td�t�	td�t�	td�t�	td�dSWt�	t�t�	td�t�	td�t�	td�t�	td�t�	td�dSt�	t�t�	td�t�	td�t�	td�t�	td�t�	td�w)Nr+r,�1/x�1/..�1/../x�/x�x�y�1/../�a/b�a�../r9�c)
rrarr4rrrr�
change_cwdr-r(rrr�test_realpath_symlink_loops�sb������
�

�z)PosixPathTest.test_realpath_symlink_loopsc
Cs��zLt�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�n31s�wYWt�
t�t�
td�t�
td�t�
td�t�
td
�t�
td
�dSWt�
t�t�
td�t�
td�t�
td�t�
td
�t�
td
�dSt�
t�t�
td�t�
td�t�
td�t�
td
�t�
td
�w)Nr+r,r�r�r�r�r�r�r�r�r�r9r�)rrarr�rrrrrr�r-r�rrr�"test_realpath_symlink_loops_strict%sj��������
�

�z0PosixPathTest.test_realpath_symlink_loops_strictc
Cs�z<t�t�t�dtt�td�t�dtd�|�ttdfi|��t�Wt�td�t�td�t	t�dSt�td�t�td�t	t�w)Nr�z/selfzself/self/selfz/link)
rrmrrarr4rrr-rr�rrr�(test_realpath_repeated_indirect_symlinksPs
�
z6PosixPathTest.test_realpath_repeated_indirect_symlinkscCsd}zpt�t�t|�D]}t�d�d|gd�td|d�qt�dtd�|�ttd|fi|��t�t�	t��|�td|�t�Wd�n1sUwYWt|d�D]}t�
td|�qatt�dSt|d�D]}t�
td|�qytt�w)N�
r9z%dz/%drqrPz/0)rrmr�rangerar6r4rrr�r-r)rrZdepth�irrr�test_realpath_deep_recursion`s"
* ���
z*PosixPathTest.test_realpath_deep_recursionc
Cs�zbt�t�t�td�t�tdtd�t�td��|�tdi|��td�Wd�n1s6wYWt�td�t	td�t	t�dSWt�td�t	td�t	t�dSt�td�t	td�t	t�w)Nz/y�/kr�z/y/a)r�)
rrmrrarr�r4rr-rr�rrr�test_realpath_resolve_parentsus&	
����
z+PosixPathTest.test_realpath_resolve_parentsc
CsFz�t�t�t�td�t�td�t�tdtd�|�ttdfi|��td�t�tt���|�tt	t�dfi|��td�Wd�n"1sRwYWt�
td�ttd�ttd�tt�dSWt�
td�ttd�ttd�tt�dSt�
td�ttd�ttd�tt�w)Nr�z/k/yz/link-yz
/link-y/..)rrmrrar4rrr�rrr-rr�rrr�(test_realpath_resolve_before_normalizing�s0
 ����
z6PosixPathTest.test_realpath_resolve_before_normalizingc
Cszut�t�t�td�t�ttd�t�tt���*tt�}|�t	|dfi|��t�|�t	|dfi|��td�Wd�n1sIwYWt�
td�ttd�tt�dSWt�
td�ttd�tt�dSt�
td�ttd�tt�w)Nr��linkzlink/k)rrmrrarr�rrr4rr-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()cCstz�t�tdt�tjtddd�|�t��ttfi|��Wd�n1s)wY|�t��ttdfi|��fWd�n1sIwY|�t��ttdfi|��Wd�n1shwY|�t��ttdfi|��Wd�n1s�wYWtjtddd�t�t�dSWtjtddd�t�t�dStjtddd�t�t�w)	Nr+rF)�follow_symlinksr0z/../fooz/foo/..��)rrar�chmodr��PermissionErrorrr-r�rrr�'test_realpath_unreadable_symlink_strict�s,������z5PosixPathTest.test_realpath_unreadable_symlink_strictc
Csfz�t�t�t�td�t�td�|�ttdd�t�|�ttdd�t�|�tttd�t�zt�t�Wn	tyAYnw|�	d�|�ttddd�td�|j
tttddd�|j
tttdtd�|�ttddd�td�|j
tttddd�|j
tttdtd�Wt�td�ttd�tt�dSt�td�ttd�tt�w)	Nr�rFr�TzCannot block permissionsz/missingr�)rrmrr�r4rr�statr�ZskipTestr�rr(rrr�"test_realpath_unreadable_directory�sJ
�
�������
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_dS|t_w)NcS�dS)Nz/home/user/barrrrrr�<lambda>��z,PosixPathTest.test_relpath.<locals>.<lambda>���r*r�r�z../a/bz../br�z/az../cz/a/bzb/cz../../arPz/foo/bar/batz/x/y/zz../../../foo/bar/batr8Zbatr9zfoo/bar/batz../../..r�z../foo/bar/batz
../../../x)
rr�rMrGr�r�r5r�r4r)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_dS|t_w)NcSr�)Ns/home/user/barrrrrrr�r�z2PosixPathTest.test_relpath_bytes.<locals>.<lambda>r�rA�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�rMrGr�r�r5r�r4r�	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)NcS�g|]}t�|��qSr�rrd��.0�prrr�
<listcomp>2�z@PosixPathTest.test_commonpath.<locals>.check.<locals>.<listcomp>)r4r5�
commonpathrrd)�pathsZexpectedr(rr�check0s�z,PosixPathTest.test_commonpath.<locals>.checkcs.��|tj|���|tjdd�|D��dS)NcSr�rr�r�rrrr�7r�zFPosixPathTest.test_commonpath.<locals>.check_error.<locals>.<listcomp>)r�r5r�)�excr�r(rr�check_error4s
�z2PosixPathTest.test_commonpath.<locals>.check_errorz/usrZusrz
/usr/localz/usr/local/z/usr//localz//usr/localz/usr/./localz/./usr/localr9z/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�r5r�r�)rr�r�rr(r�test_commonpath/s\
�
�
�
�
�
�zPosixPathTest.test_commonpath)9�__name__�
__module__�__qualname__r)r'r7rHrOrRrUrVrWrfrhrnrZ
skipUnlessrr`roZskipIfrrr{r}rr�r�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�rrrrr&=s�




�


�
'		��
W��'�'�����"r&c@seZdZeZgd�ZdS)�PosixCommonTest)r��samefile�sameopenfile�samestatN)r�r�r�r5Z
pathmoduleZ
attributesrrrrr�fsr�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),�
PathLikeTestscCsbtj|_ttj�|_|�tj|j�t|jdd��}|�d�Wd�dS1s*wYdS)NZxbrstest_posixpath.PathLikeTests)	rr.�	file_namer�	file_pathZ
addCleanupr-r^r_)r�filerrrr)os"�zPathLikeTests.setUpcCs|�||j�||j��dSr)r4r�r�)rr rrr�assertPathEqualvszPathLikeTests.assertPathEqualcC�|�|jj�dSr)r�rM�normcaser(rrr�test_path_normcasey�z PathLikeTests.test_path_normcasecCr�r)r�rMrTr(rrr�test_path_isabs|rzPathLikeTests.test_path_isabscCs,|�|j�dtd�d�|j�ddd��dS)Nr��br�)r4rMr6rr(rrr�test_path_joins�zPathLikeTests.test_path_joincCr�r)r�rMrGr(rrr�test_path_split�rzPathLikeTests.test_path_splitcCr�r)r�rMrKr(rrr�test_path_splitext�rz PathLikeTests.test_path_splitextcCr�r)r�rM�
splitdriver(rrr�test_path_splitdrive�rz"PathLikeTests.test_path_splitdrivecCr�r)r�rMrr(rrr�test_path_basename�rz PathLikeTests.test_path_basenamecCr�r)r�rMrr(rrr�test_path_dirname�rzPathLikeTests.test_path_dirnamecCr�r)r�rMr\r(rrr�test_path_islink�rzPathLikeTests.test_path_islinkcCr�r)r�rMr]r(rrr�test_path_lexists�rzPathLikeTests.test_path_lexistscCr�r)r�rMrgr(rrr�test_path_ismount�rzPathLikeTests.test_path_ismountcCr�r)r�rMr~r(rrr�test_path_expanduser�rz"PathLikeTests.test_path_expandusercCr�r)r�rM�
expandvarsr(rrr�test_path_expandvars�rz"PathLikeTests.test_path_expandvarscCr�r)r�rMr�r(rrr�test_path_normpath�rz PathLikeTests.test_path_normpathcCr�r)r�rMrr(rrr�test_path_abspath�rzPathLikeTests.test_path_abspathr�TcCs,|�|jj�|�t|jjfi|���dSr)r�rMrrr�rrr�test_path_realpath�sz PathLikeTests.test_path_realpathcCr�r)r�rMr�r(rrr�test_path_relpath�rzPathLikeTests.test_path_relpathcCs&|j�|j|jg�}|�||j�dSr)rMr�r�r�r4)rZcommon_pathrrr�test_path_commonpath�sz"PathLikeTests.test_path_commonpathN)r�r�r�r5rMr)r�r�rrrrrrr	r
rrr
rrrr%rrrrrrrrr�ks.
r��__main__)"rr5r�r�	functoolsrrrrrrrrr	Ztest.supportr
rZtest.support.os_helperrr
rr�ImportErrorr.rrrr%ZTestCaser&Z
CommonTestr�r�r��mainrrrr�<module>sB�

/J�