403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.230
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_posixpath.cpython-36.pyc
3

�w2_�r�
@s�ddlZddlZddlZddlZddlmZmZmZmZddlm	Z	m
Z
ddlmZddlm
Z
yddlZWnek
r�dZYnXee	j�Zdd�Zdd	�ZGd
d�dej�ZGdd
�d
e
jej�ZGdd�dej�Zedkr�ej�dS)�N)�realpath�abspath�dirname�basename)�support�test_genericpath)�FakePath)�mockcCs"dtk}d}|tj|�|�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/python36/lib64/python3.6/test/test_posixpath.py�!skip_if_ABSTFN_contains_backslashsrcCs(ytj|�Wntk
r"YnXdS)N)�os�rmdir�OSError)rrrr�
safe_rmdirsrc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zejej�d�dd��Zejedkd�dd��Zejedkd�d d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zed*d+��Zed,d-��Zejee d.�d/�ed0d1���Z!ejee d.�d/�ed2d3���Z"ejee d.�d/�ed4d5���Z#ejee d.�d/�ed6d7���Z$ejee d.�d/�ed8d9���Z%ejee d.�d/�ed:d;���Z&ejee d.�d/�ed<d=���Z'ejee d.�d/�ed>d?���Z(d@dA�Z)dBdC�Z*dDdE�Z+dS)F�
PosixPathTestcCs|j�dS)N)�tearDown)�selfrrr�setUp&szPosixPathTest.setUpcCs0x*dD]"}tjtj|�ttj|�qWdS)N��1�2)rrr)r�unlink�TESTFNr)r�suffixrrrr)s
zPosixPathTest.tearDowncCs�|jtjdddd�d�|jtjddd�d�|jtjddd	�d
�|jtjddd
d�d�|jtjddd�d�|jtjddd�d�dS)Nz/foo�barz/barZbazz/bar/bazz/foo/bar/bazz/foo/zbar/zbaz/z
/foo/bar/baz/s/foosbars/barsbazs/bar/bazs/foo/bar/bazs/foo/sbar/sbaz/s
/foo/bar/baz/)�assertEqual�	posixpath�join)rrrr�	test_join.szPosixPathTest.test_joincCs�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd	�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�dS)Nz/foo/bar�/foor!�/r�fooz////foo�////z
//foo//bar�//foos/foo/bar�/foo�bar�/��foos////foo�////s
//foo//bar�//foo)r&r!)r'r)rr()r)r()r*r!)r+r,)r-r.)r.r/)r0r/)r1r,)r"r#�split)rrrr�
test_split<szPosixPathTest.test_splitcCs�|jtj|�||f�|jtjd|�d||f�|jtjd|�d||f�|jtjd|�d||f�|jtjd|�d||f�|jtj|d�||ddf�t|d�}t|d�}t|d�}|jtj|�||f�|jtjd|�d||f�|jtjd|�d||f�|jtjd	|�d	||f�|jtjd
|�d
||f�|jtj|d�||ddf�dS)Nr'zabc/zabc.def/z	/abc.def/r�ASCIIr-sabc/sabc.def/s	/abc.def/r.)r"r#�splitext�bytes)r�path�filenameZextrrr�splitextTestIs0


zPosixPathTest.splitextTestcCs�|jddd�|jddd�|jddd�|jdd	d
�|jddd�|jd
d
d�|jddd�|jddd�|jddd�|jddd�|jddd�|jddd�dS)Nzfoo.barr(z.barzfoo.boo.barzfoo.boozfoo.boo.biff.barzfoo.boo.biffz.csh.rcz.cshz.rcZnodotsrz.cshrcz...manydotsz...manydots.extz.ext�.z..z........)r9)rrrr�
test_splitexteszPosixPathTest.test_splitextcCs�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd	�d�|jtjd
�d�|jtjd�d�|jtjd�d�dS)
NrFr'Tz/fooz/foo/barzfoo/barr.r-s/foos/foo/barsfoo/bar)�assertIsr#�isabs)rrrr�
test_isabssszPosixPathTest.test_isabscCs�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d	�|jtjd
�d�|jtjd�d�|jtjd
�d�|jtjd�d	�dS)Nz/foo/barr!r'rr(z////fooz
//foo//bars/foo/barsbarr-r.sfoos////foos
//foo//bar)r"r#r)rrrr�
test_basename�szPosixPathTest.test_basenamecCs�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d	�|jtjd
�d�|jtjd�d�|jtjd
�d�|jtjd�d�|jtjd�d�dS)Nz/foo/barz/foor'r(rz////fooz////z
//foo//barz//foos/foo/bars/foor-sfoor.s////foos////s
//foo//bars//foo)r"r#r)rrrr�test_dirname�szPosixPathTest.test_dirnamecCs|jtjtjd�d�|jtjtjd�d�ttjdd��}|jd�WdQRX|jtjtjd�d�tj�r�t	j
tjdtjd�|jtjtjd�d�t	jtjd�|jtjtjd�d�|jtjtjd�d�|jtjtjd�d�dS)NrFr�wbsfooT)
r<r#�islinkrr�lexists�open�write�can_symlinkr�symlink�remove�exists)r�frrr�test_islink�szPosixPathTest.test_islinkcCs(|jtjd�d�|jtjd�d�dS)Nr'Tr-)r<r#�ismount)rrrr�test_ismount�szPosixPathTest.test_ismountcCsB|jtjt�d�z tjt�|jtjt�d�Wdtt�XdS)NF)r<r#rLrr�mkdirr)rrrr�test_ismount_non_existent�s

z'PosixPathTest.test_ismount_non_existentzTest requires symlink supportcCs4z"tjdt�|jtjt�d�Wdtjt�XdS)Nr'F)rrGrr<r#rLr)rrrr�test_ismount_symlinks�sz#PosixPathTest.test_ismount_symlinksNzTest requires posix modulecCs8tj}dd�}z|t_|jtjt�d�Wd|t_XdS)NcSs6d}d}|tkrd}d}tjd||dddddddf
�S)Nr�)r�posix�stat_result)r7�st_ino�st_devrrr�
fake_lstat�sz?PosixPathTest.test_ismount_different_device.<locals>.fake_lstatT)r�lstatr<r#rLr)r�
save_lstatrVrrr�test_ismount_different_device�sz+PosixPathTest.test_ismount_different_devicecCs8tj}dd�}z|t_|jtjt�d�Wd|t_XdS)NcSsPd}d}|jt�r"|tkr"td��|tkr2d}d}tjd||dddddddf
�S)Nrz!Fake [Errno 13] Permission deniedrQ)�
startswithrrrRrS)r7rTrUrrrrV�szEPosixPathTest.test_ismount_directory_not_readable.<locals>.fake_lstatT)rrWr<r#rLr)rrXrVrrr�#test_ismount_directory_not_readable�sz1PosixPathTest.test_ismount_directory_not_readablecCs(|jtjd�d�|jtjd�d�dS)Nr(sfoo)r"r#�
expanduser)rrrr�test_expanduser�szPosixPathTest.test_expandusercCs�tj���}d|d<|jtjd�d�d|d<|jtjd�d�xbd
D]Z}|j|d	��D||d<|jtjd�d�|jtjd
�d�|jtjd�d�WdQRXqDWWdQRXdS)Nz/home/victor�HOME�~z
/home/victor/r'r�//�///)�homez~/z~/fooz/foo)r'rr`ra)r�EnvironmentVarGuardr"r#r\ZsubTest)r�envrbrrr�test_expanduser_home_envvar�s

z)PosixPathTest.test_expanduser_home_envvarcCshtjd�}|jtjd�t�|jtjd�t�tjd�dkrt|jtjd�dtjd��|jtjd�dtjd��|jtjd�t�|jtjd	�t�|jtjd
�t�|jtjd�t�tj���}|d=|j	t
j��j}|j
d�p�d}|jtjd�|�tjj|d
td��Ftjj|dtd��(x dD]}|jtj|�|��q*WWdQRXWdQRXWdQRXdS)N�pwdz~/s~/r_r'�~r-z~root/z~foo/s~root/s~foo/r^�getpwuid)Zside_effect�getpwnam�~/.local�
~vstinner/)r_rjrk)r�
import_moduleZassertIsInstancer#r\�strr6r"rcrhr�getuid�pw_dir�rstripr	Zpatch�object�KeyError)rrfrdrbr7rrr�test_expanduser_pwd�s.


z!PosixPathTest.test_expanduser_pwdcCs|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d	�|jtjd
�d�|jtjd�d�|jtjd
�d
�|jtjd�d�|jtjd�d
�|jtjd�d�|jtjd�d�|jtjd�d�dS)Nrr: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)rrrr�
test_normpath"s"zPosixPathTest.test_normpathcCs�|jtd�tj��|jtd�tj��|jtdjdgd��tj��|jtd�tj��|jtd�tj��|jtdjdgd��tj��dS)Nr:z./.r'�drts./.r-)r"rr�getcwdr$�getcwdb)rrrr�test_realpath_curdir6s z"PosixPathTest.test_realpath_curdircCs�|jtd�ttj���|jtd�tttj����|jtdjdgd��d�|jtd�ttj���|jtd�tttj����|jtdjdgd��d�dS)Nz..z../..r'rws..s../..r-)r"rrrrxr$ry)rrrr�test_realpath_pardir@sz"PosixPathTest.test_realpath_pardirrGzMissing symlink implementationcCs:z(tjtdt�|jtt�td�Wdtjt�XdS)Nr)rrGrr"rrr)rrrr�test_realpath_basicJsz!PosixPathTest.test_realpath_basiccCs@z.tjtjtd�t�|jtt�td�Wdtjt�XdS)Nr)	rrGr#�relpathrr"rrr)rrrr�test_realpath_relativeUsz$PosixPathTest.test_realpath_relativecCs�z�tjtt�|jtt�t�tjtdtd�tjtdtd�|jttd�td�|jttd�td�|jttd�td�|jttd�tt��|jttd�tt�d�tjtdtd�|jttd	tt�d�td�|jttd	tt�d�td�tjtt�d
td�|jttd�td
�tjdttt��d
tt�dtd�|jttd�td�tjtt���|jttt��t�WdQRXWdtj	t�tj	td�tj	td�tj	td�tj	td�tj	td�XdS)Nrrz1/xz1/..z1/../xz/x�x�yz1/../za/b�az../r'�c)
rrGrr"rrrr�
change_cwdr)rrrr�test_realpath_symlink_loops_s8

("
z)PosixPathTest.test_realpath_symlink_loopscCsvzJtjt�tjdtt�td�tjdtd�|jttd�t�Wdtjtd�tjtd�t	t�XdS)Nz../z/selfzself/self/selfz/link)
rrNrrGrr"rrrr)rrrr�(test_realpath_repeated_indirect_symlinks�s
z6PosixPathTest.test_realpath_repeated_indirect_symlinkscCs�d}z�tjt�x8t|�D],}tjdjd|gd�td|d�qWtjdtd�|jttd|�t�tj	t��|jtd|�t�WdQRXWdx&t|d�D]}tj
td|�q�Wtt�XdS)N�
r'z%dz/%drQr:z/0)rrNr�rangerGr$r"rrr�rr)rZdepth�irrr�test_realpath_deep_recursion�s
,"z*PosixPathTest.test_realpath_deep_recursioncCs�z^tjt�tjtd�tjtdtd�tjtd��|jtd�td�WdQRXWdtjtd�t	td�t	t�XdS)Nz/yz/kr�z/y/a)
rrNrrGrr�r"rrr)rrrr�test_realpath_resolve_parents�s
"z+PosixPathTest.test_realpath_resolve_parentscCs�z�tjt�tjtd�tjtd�tjtdtd�|jttd�td�tjtt���"|jtt	t�d�td�WdQRXWdtj
td�ttd�ttd�tt�XdS)Nz/kz/k/yz/link-yz
/link-y/..)rrNrrGr"rrr�rrrr)rrrr�(test_realpath_resolve_before_normalizing�s
z6PosixPathTest.test_realpath_resolve_before_normalizingcCs�zztjt�tjtd�tjttd�tjtt���:tt�}|jt	|d�t�|jt	|d�td�WdQRXWdtj
td�ttd�tt�XdS)Nz/k�linkzlink/k)rrNrrGrr�rrr"rrr)r�baserrr�test_realpath_resolve_first�s
&z)PosixPathTest.test_realpath_resolve_firstcCs�tjdd�}t_�z�tjjtj��d}|jttjd�|jtjd�d�|jtjtj	d��d�|jtjd�d�|jtjd�d�|jtjdd�d	|d
�|jtjdd�d	|d�|jtjdd
�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjd
d
�d�|jtjdd�d�Wd|t_XdS)NcSsdS)Nz/home/user/barrrrrr�<lambda>�sz,PosixPathTest.test_relpath.<locals>.<lambda>rQrr�za/bz../a/bz../bz../z/az../cz/a/bzb/cz../../ar:z/foo/bar/batz/x/y/zz../../../foo/bar/batz/foo/barZbatr'zfoo/bar/batz../../..z/xz../foo/bar/batz
../../../x���)
rrxr7r2�assertRaises�
ValueErrorr#r}r"r)rZreal_getcwd�curdirrrr�test_relpath�s.zPosixPathTest.test_relpathcCs�tjdd�}t_�z�tjjtj��d}|jttjd�|jtjd�d�|jtjtj	d��d�|jtjd�d�|jtjd�d�|jtjdd�d	|d
�|jtjdd�d	|d�|jtjdd
�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjdd�d�|jtjd
d
�d�|jtjdd�d�|jt
tjdd�|jt
tjdd�Wd|t_XdS)NcSsdS)Ns/home/user/barrrrrrr�sz2PosixPathTest.test_relpath_bytes.<locals>.<lambda>rQr.�asa/bs../a/bs../bs../s/as../cs/a/bsb/cs../../arts/foo/bar/bats/x/y/zs../../../foo/bar/bats/foo/barsbatr-sfoo/bar/bats../../..s/xs../foo/bar/bats
../../../xsbytesrmr�)rryr7r2r�r�r#r}r"r�	TypeError)rZreal_getcwdbr�rrr�test_relpath_bytess4z PosixPathTest.test_relpath_bytescs�fdd�}�fdd�}�jttjg�|tddg�|tddg�|dgd�|ddgd�|ddgd�|ddgd�|d	d
gd�|ddgd�|d
dgd
�|ddgd
�|ddgd�|ddgd�|ddgd�|ddgd�|dgd�|ddgd�|ddgd�|ddgd�|ddgd�|ddgd�|dddgd�|dddgd�|dgd�|ddgd�|tddg��jttjd dg��jttjd d!g��jttjd"dg��jttjdd#g��jttjdd$g��jttjd%d#g�dS)&Ncs8�jtj|�|��jtjdd�|D��tj|��dS)NcSsg|]}tj|��qSr)r�fsencode)�.0�prrr�
<listcomp>,sz@PosixPathTest.test_commonpath.<locals>.check.<locals>.<listcomp>)r"r#�
commonpathrr�)�pathsZexpected)rrr�check*sz,PosixPathTest.test_commonpath.<locals>.checkcs.�j|tj|��j|tjdd�|D��dS)NcSsg|]}tj|��qSr)rr�)r�r�rrrr�1szFPosixPathTest.test_commonpath.<locals>.check_error.<locals>.<listcomp>)r�r#r�)�excr�)rrr�check_error.s
z2PosixPathTest.test_commonpath.<locals>.check_errorz/usrZusrz
/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/lib64ZspamZalotrzand/jamzand/spam�andzand//jamz
and/spam//z	and/./jamz
./and/spamz	spam/alotz
/spam/alots	/usr/lib/zusr/lib/python3susr/lib/s/usr/lib/python3susr/lib/python3zusr/lib/)r�r�r#r�r�)rr�r�r)rr�test_commonpath)sP










zPosixPathTest.test_commonpath),�__name__�
__module__�__qualname__rrr%r3r9r;r>r?r@rKrMrOrZ
skipUnlessrrFrPZskipIfrRrYr[r]rersrvrrzr{�hasattrrr|r~r�r�r�r�r�r�r�r�r�rrrrr$sb



	
	'

	(
rc@seZdZeZddddgZdS)�PosixCommonTestr}�samefile�sameopenfile�samestatN)r�r�r�r#Z
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"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�
PathLikeTestsc	CsPtjj�|_ttj�|_|jtj|j�t|jdd��}|j	d�WdQRXdS)NZxbrstest_posixpath.PathLikeTests)
rr�lower�	file_namer�	file_pathZ
addCleanuprrDrE)r�filerrrris
zPathLikeTests.setUpcCs|j||j�||j��dS)N)r"r�r�)r�funcrrr�assertPathEqualpszPathLikeTests.assertPathEqualcCs|j|jj�dS)N)r�r7�normcase)rrrr�test_path_normcasessz PathLikeTests.test_path_normcasecCs|j|jj�dS)N)r�r7r=)rrrr�test_path_isabsvszPathLikeTests.test_path_isabscCs,|j|jjdtd�d�|jjddd��dS)Nr��br�)r"r7r$r)rrrr�test_path_joinyszPathLikeTests.test_path_joincCs|j|jj�dS)N)r�r7r2)rrrr�test_path_split}szPathLikeTests.test_path_splitcCs|j|jj�dS)N)r�r7r5)rrrr�test_path_splitext�sz PathLikeTests.test_path_splitextcCs|j|jj�dS)N)r�r7�
splitdrive)rrrr�test_path_splitdrive�sz"PathLikeTests.test_path_splitdrivecCs|j|jj�dS)N)r�r7r)rrrr�test_path_basename�sz PathLikeTests.test_path_basenamecCs|j|jj�dS)N)r�r7r)rrrr�test_path_dirname�szPathLikeTests.test_path_dirnamecCs|j|jj�dS)N)r�r7rB)rrrr�test_path_islink�szPathLikeTests.test_path_islinkcCs|j|jj�dS)N)r�r7rC)rrrr�test_path_lexists�szPathLikeTests.test_path_lexistscCs|j|jj�dS)N)r�r7rL)rrrr�test_path_ismount�szPathLikeTests.test_path_ismountcCs|j|jj�dS)N)r�r7r\)rrrr�test_path_expanduser�sz"PathLikeTests.test_path_expandusercCs|j|jj�dS)N)r�r7�
expandvars)rrrr�test_path_expandvars�sz"PathLikeTests.test_path_expandvarscCs|j|jj�dS)N)r�r7ru)rrrr�test_path_normpath�sz PathLikeTests.test_path_normpathcCs|j|jj�dS)N)r�r7r)rrrr�test_path_abspath�szPathLikeTests.test_path_abspathcCs|j|jj�dS)N)r�r7r)rrrr�test_path_realpath�sz PathLikeTests.test_path_realpathcCs|j|jj�dS)N)r�r7r})rrrr�test_path_relpath�szPathLikeTests.test_path_relpathcCs&|jj|j|jg�}|j||j�dS)N)r7r�r�r�r")rZcommon_pathrrr�test_path_commonpath�sz"PathLikeTests.test_path_commonpathN)r�r�r�r#r7rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�es*r��__main__)rr#r�warningsrrrrrrrZtest.supportrr	rR�ImportErrorrrrrZTestCaserZ
CommonTestr�r�r��mainrrrr�<module>s.


@G

Youez - 2016 - github.com/yon3zu
LinuXploit