Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_ntpath.cpython-39.opt-2.pyc

a

��gK��@s<ddlZddlZddlZddlZddlZddlmZmZddlm	Z	m
Z
ddlmZzddl
Z
WneyvdZ
Yn0z
ejWney�dZYn0dZzddlZWney�dZYn0dZdd�Zd	d
�Zdd�ZGd
d�dej�ZGdd�de�ZGdd�de
jej�ZGdd�de�Zedk�r8e��dS)�N)�
TestFailed�FakePath)�support�test_genericpath)�
TemporaryFileFTcCsntjddd�j}tjtjtjg|_tj|_||dd�}|sLtd�t�	����t�
|�}||||�}|d|�S)NZkernel32T)Zuse_last_errorrz&failed to get short path name 0x{:08X})�ctypesZWinDLLZGetShortPathNameWZ	c_wchar_pZc_uint32�argtypesZrestype�OSError�formatZget_last_errorZcreate_unicode_buffer)�pathZGSPNZ
result_len�result�r
�,/usr/local/lib/python3.9/test/test_ntpath.py�_getshortpathnames�
rcCsBt|tttjf�r"t�t�|��St|d�r>t	dd�|D��S|S)N�__iter__css|]}t�t�|��VqdS�N)�ntpath�normcase�os�fsdecode��.0�pr
r
r�	<genexpr>/�z_norm.<locals>.<genexpr>)
�
isinstance�bytes�strr�PathLikerrr�hasattr�tuple)rr
r
r�_norm+s

r!cCs$|�dd�}t|�}||krJt|�t|�krJtdt|�t|�t|�f��|�dd�}|�dd�}|�dd	�}|�d
d�}|�dd
�}|�dd�}t�|��d�}|�dd��d�}t	�
��$t	�dt�t|�}Wd�n1s�0Yt|�t|�k�r tdt|�t|�t
|�f��dS)N�\�\\z%%s should return: %s but returned: %sz('z(b'z("z(b"z['z[b'z["z[b"z, 'z, b'z, "z, b"�latin1�ascii�backslashreplace�ignore)�replace�evalr!rrr�fsencode�decode�encode�warnings�catch_warnings�simplefilter�DeprecationWarning�repr)�fnZ
wantResultZ	gotResultr
r
r�tester3s*�
&�r3c@seZdZdd�Zdd�ZdS)�NtpathTestCasecCs,||kst|�t|�krdS|�||�dSr)r!�assertEqual)�selfZpath1Zpath2r
r
r�assertPathEqualLszNtpathTestCase.assertPathEqualcCs|�t|�t|��dSr)ZassertInr!)r6rZpathsetr
r
r�assertPathInQszNtpathTestCase.assertPathInN)�__name__�
__module__�__qualname__r7r8r
r
r
rr4Ksr4c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zej
e�ed�dd���Zej
e�ed�dd���Zej
e�ed�dd���Zej
e�ed�dd���Zej
e�ed�dd���Ze�ed�dd��Ze�ed�e�ed �d!d"���Zd#d$�Ze�ejd%�d&d'��Zd(d)�Ze�ed*�d+d,��Zd-d.�Zd/d0�Z d1d2�Z!d3d4�Z"d5d6�Z#e�ed7�d8d9��Z$d:S);�
TestNtpathcCshtdd�tdd�tdd�tdd�td	d
�tdd�td
d�tdd�tdd�tdd�dS)Nzntpath.splitext("foo.ext"))�foo�.extzntpath.splitext("/foo/foo.ext"))z/foo/foor>zntpath.splitext(".ext"))r>�zntpath.splitext("\foo.ext\foo"))z\foo.ext\foor?zntpath.splitext("foo.ext\"))zfoo.ext\r?zntpath.splitext(""))r?r?zntpath.splitext("foo.bar.ext"))zfoo.barr>z!ntpath.splitext("xx/foo.bar.ext"))z
xx/foo.barr>z!ntpath.splitext("xx\foo.bar.ext"))z
xx\foo.barr>zntpath.splitext("c:a/b\c.d"))zc:a/b\cz.d�r3�r6r
r
r�
test_splitextVs








zTestNtpath.test_splitextcCsftdd�tdd�tdd�tdd�td	d
�tdd�td
d�tdd�|�t�d�d�dS)Nzntpath.splitdrive("c:\foo\bar"))�c:�\foo\barzntpath.splitdrive("c:/foo/bar"))rC�/foo/barz/ntpath.splitdrive("\\conky\mountpoint\foo\bar"))z\\conky\mountpointrDz/ntpath.splitdrive("//conky/mountpoint/foo/bar"))z//conky/mountpointrEz0ntpath.splitdrive("\\\conky\mountpoint\foo\bar"))r?z\\\conky\mountpoint\foo\barz0ntpath.splitdrive("///conky/mountpoint/foo/bar"))r?z///conky/mountpoint/foo/barz0ntpath.splitdrive("\\conky\\mountpoint\foo\bar"))r?z\\conky\\mountpoint\foo\barz0ntpath.splitdrive("//conky//mountpoint/foo/bar"))r?z//conky//mountpoint/foo/baru//conky/MOUNTPOİNT/foo/bar)u//conky/MOUNTPOİNTrE)r3r5r�
splitdriverAr
r
r�test_splitdrivebs6���������zTestNtpath.test_splitdrivecCs@tdd�tdd�tdd�tdd�td	d
�tdd�dS)
Nzntpath.split("c:\foo\bar"))zc:\foo�barz*ntpath.split("\\conky\mountpoint\foo\bar"))z\\conky\mountpoint\foorHzntpath.split("c:\"))�c:\r?z#ntpath.split("\\conky\mountpoint\"))z\\conky\mountpoint\r?zntpath.split("c:/"))�c:/r?z#ntpath.split("//conky/mountpoint/"))z//conky/mountpoint/r?r@rAr
r
r�
test_splitws
�
�
zTestNtpath.test_splitcCs,tdd�tdd�tdd�tdd�dS)Nzntpath.isabs("c:\")�z#ntpath.isabs("\\conky\mountpoint\")zntpath.isabs("\foo")zntpath.isabs("\foo\bar")r@rAr
r
r�
test_isabs�s


zTestNtpath.test_isabscCs"tdd�tdd�tdd�dS)Nz>ntpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"])z
/home/swenz;ntpath.commonprefix(["\home\swen\spam", "\home\swen\eggs"])z\home\swen\z;ntpath.commonprefix(["/home/swen/spam", "/home/swen/spam"])z/home/swen/spamr@rAr
r
r�test_commonprefix�s���zTestNtpath.test_commonprefixcCs6tdd�tdd�tdd�tdd�tdd	�td
d�tdd
�tdd�tdd�tdd�tdd�tdd�tdd�tdd�tdd�tdd�tdd�tdd�tdd�td d�td!d"�td#d$�td%d&�td'd(�td)d*�td+d,�td-d.�td/d0�td1d2�td3d4�td5d6�td7d8�td9d:�td;d<�td=d<�td>d0�td?d0�td@d0�tdAd0�tdBd8�tdCd8�tdDd8�tdEdF�tdGdH�tdIdJ�tdKdL�dMD]$}dND]}tdO||f|��qؐq�tdPdQ�tdRdQ�tdSdQ�tdTdU�tdVdW�tdXdY�dS)ZNzntpath.join("")r?zntpath.join("", "", "")zntpath.join("a")�azntpath.join("/a")z/azntpath.join("\a")�\azntpath.join("a:")za:zntpath.join("a:", "\b")za:\bzntpath.join("a", "\b")z\bzntpath.join("a", "b", "c")za\b\czntpath.join("a\", "b", "c")zntpath.join("a", "b\", "c")zntpath.join("a", "b", "\c")z\czntpath.join("d:\", "\pleep")zd:\pleepzntpath.join("d:\", "a", "b")zd:\a\bzntpath.join('', 'a')z ntpath.join('', '', '', '', 'a')zntpath.join('a', '')za\z ntpath.join('a', '', '', '', '')zntpath.join('a\', '')z!ntpath.join('a\', '', '', '', '')zntpath.join('a/', '')za/zntpath.join('a/b', 'x/y')za/b\x/yzntpath.join('/a/b', 'x/y')z/a/b\x/yzntpath.join('/a/b/', 'x/y')z/a/b/x/yzntpath.join('c:', 'x/y')zc:x/yzntpath.join('c:a/b', 'x/y')z	c:a/b\x/yzntpath.join('c:a/b/', 'x/y')z	c:a/b/x/yzntpath.join('c:/', 'x/y')zc:/x/yzntpath.join('c:/a/b', 'x/y')z
c:/a/b\x/yzntpath.join('c:/a/b/', 'x/y')z
c:/a/b/x/yz&ntpath.join('//computer/share', 'x/y')z//computer/share\x/yz'ntpath.join('//computer/share/', 'x/y')z//computer/share/x/yz*ntpath.join('//computer/share/a/b', 'x/y')z//computer/share/a/b\x/yzntpath.join('a/b', '/x/y')z/x/yzntpath.join('/a/b', '/x/y')zntpath.join('c:', '/x/y')zntpath.join('c:a/b', '/x/y')zntpath.join('c:/', '/x/y')zntpath.join('c:/a/b', '/x/y')z'ntpath.join('//computer/share', '/x/y')z(ntpath.join('//computer/share/', '/x/y')z)ntpath.join('//computer/share/a', '/x/y')zntpath.join('c:', 'C:x/y')zC:x/yzntpath.join('c:a/b', 'C:x/y')z	C:a/b\x/yzntpath.join('c:/', 'C:x/y')zC:/x/yzntpath.join('c:/a/b', 'C:x/y')z
C:/a/b\x/y)
r?za/bz/a/brCzc:a/brJzc:/a/bz//computer/sharez//computer/share/z//computer/share/a/b)zd:zd:x/yzd:/zd:/x/yz//machine/commonz//machine/common/z//machine/common/x/yzntpath.join(%r, %r)z*ntpath.join('\\computer\share\', 'a', 'b')z\\computer\share\a\bz)ntpath.join('\\computer\share', 'a', 'b')z&ntpath.join('\\computer\share', 'a\b')z*ntpath.join('//computer/share/', 'a', 'b')z//computer/share/a\bz)ntpath.join('//computer/share', 'a', 'b')z//computer/share\a\bz&ntpath.join('//computer/share', 'a/b')z//computer/share\a/br@)r6�x�yr
r
r�	test_join�sn


















































zTestNtpath.test_joincCs�tdd�tdd�tdd�tdd�tdd�td	d
�tdd�td
d�tdd�tdd�tdd�tdd�tdd�tdd�tdd�tdd�tdd�tdd�td d!�td"d#�td$d%�td&d'�dS)(Nz$ntpath.normpath('A//////././//.//B')zA\Bzntpath.normpath('A/./B')zntpath.normpath('A/foo/../B')zntpath.normpath('C:A//B')zC:A\Bzntpath.normpath('D:A/./B')zD:A\Bzntpath.normpath('e:A/foo/../B')ze:A\Bzntpath.normpath('C:///A//B')zC:\A\Bzntpath.normpath('D:///A/./B')zD:\A\Bz"ntpath.normpath('e:///A/foo/../B')ze:\A\Bzntpath.normpath('..')�..zntpath.normpath('.')�.zntpath.normpath('')zntpath.normpath('/')r"zntpath.normpath('c:/')rIzntpath.normpath('/../.././..')zntpath.normpath('c:/../../..')zntpath.normpath('../.././..')�..\..\..zntpath.normpath('K:../.././..')z
K:..\..\..zntpath.normpath('C:////a/b')zC:\a\bz'ntpath.normpath('//machine/share//a/b')z\\machine\share\a\bzntpath.normpath('\\.\NUL')�\\.\NULzntpath.normpath('\\?\D:/XY\Z')z\\?\D:/XY\Zr@rAr
r
r�
test_normpath�s,




















zTestNtpath.test_normpathcCsDt�t���}td|�td|�td|�td|�td|�dS)Nzntpath.realpath('.')zntpath.realpath('./.')z&ntpath.realpath('/'.join(['.'] * 100))zntpath.realpath('.\.')z&ntpath.realpath('\'.join(['.'] * 100)))r�normpathr�getcwdr3�r6�expectedr
r
r�test_realpath_curdir�s



zTestNtpath.test_realpath_curdircCs~t�t���}tdt�|��tdt�t�|���tdt�|�dd�tdt�t�|���tdt�|�dd�dS)Nzntpath.realpath('..')zntpath.realpath('../..')z&ntpath.realpath('/'.join(['..'] * 50))rr"zntpath.realpath('..\..')z&ntpath.realpath('\'.join(['..'] * 50)))rrYrrZr3�dirnamerFr[r
r
r�test_realpath_pardir�s����zTestNtpath.test_realpath_pardirzneed _getfinalpathnamecCs�t�tj�}t|d���|�tj|�|�tj|d�t�	||d�|�
t�|d�|�|�
t�t�|d��t�|��dS�N�wb�1)
r�abspathr�TESTFN�open�close�
addCleanup�unlinkr�symlinkr7�realpathr*�r6�ABSTFNr
r
r�test_realpath_basics�zTestNtpath.test_realpath_basiccCsjt�tj�}t|d���|�tj|�|�tj|d�t�	|t�
|d��|�t�|d�|�dSr`)
rrcrrdrerfrgrhrri�relpathr7rjrkr
r
r�test_realpath_relativesz!TestNtpath.test_realpath_relativecCstt�tj�}t�|�|�tj|�t�|���.t�d�t�	d�t�
dd�t�
dd�t�	d�t�
dd�t�
dd�t�
d	d
�t�
dd�t�
d
d�t�
|dd�t�
dd�|�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�t�
|d��|�t�d�t�
|d��|�t�d�t�
|d��|�t�d�t�
|d��|�t�d�t�
|d��|�t�d �t�
|d��|�t�d!�t�
|d��|�t�d"�t�
|d��Wd�n1�sf0YdS)#NZsubdirrU�	recursiverT�parentr6�missing�brokenz
broken\barZbroken1zself\self\brokenZbroken2z"subdir\parent\subdir\parent\brokenZbroken3z\brokenZbroken4zrecursive\..\brokenZbroken5z\missingz
broken\fooz\missing\fooz\broken\barzbroken1\bazz\broken\bar\bazz\self\self\missingz$\subdir\parent\subdir\parent\missingsbrokens
broken\foosbroken1sbroken1\bazsbroken2sbroken3sbroken4sbroken5)rrcrrdr�mkdirrg�rmtree�
change_cwd�chdirrir7rjr*rkr
r
r�test_realpath_broken_symlinkss�



����������������z(TestNtpath.test_realpath_broken_symlinkscCsNt�tj�}|�tj|�|�tj|d�|�tj|d�|�tj|d�|�tj|d�|�tj|d�t�||�|�t�	|�|�t�|d|d�t�|d|d�|d|df}|�
t�	|d�|�|�
t�	|d�|�|�
t�	|d�dd�|D��|�t�	|d	�t�|��|�t�	|d
�t�|�d�t�|d|d�|�t�	|d
t�|�d�|d�|�
t�	|d
t�|�d�|�t�t�|�d|d�|�t�	|d�|d�t�dt�t�|��dt�|�d|d�|�t�	|d�|d�|�t�	t�|��|�dS)Nrb�2rR�crOz1\xcss|]}t�|d�VqdS)rQN)r�join)r�rr
r
rrirz9TestNtpath.test_realpath_symlink_loops.<locals>.<genexpr>z1\..z1\..\xz\xrQz1\..\�a\b�..\r")
rrcrrdrgrhrrir7rjr8r^�basename)r6rlr\r
r
r�test_realpath_symlink_loopsRsf�������������z&TestNtpath.test_realpath_symlink_loopscCst�tj�}|�tj|d�|�tjd|d�|�tj|d�|�tj|d�t|dd��}|�d�Wd�n1s�0Yt�	|d|d�td|dd��}|�d�Wd�n1s�0Yt�	d|d|d�|�
t�|d�|d�|�
t�|d�d|d�tt�|d�d	�� }|�|�
�d�Wd�n1�sl0Ytt�|d�d	�� }|�|�
�d�Wd�n1�s�0Y|�
t�d|d�d|d�|�
t�d|d�d|d�dS)
N�3z\\?\z3.Z3linkz3.linkra�0�1�rb)rrcrrdrgrhre�writerrir7rjr5�read)r6rl�fr
r
r�test_realpath_symlink_prefix�s6((�
�00
�
�z'TestNtpath.test_realpath_symlink_prefixcCstdd�dS)Nzntpath.realpath('NUL')rWr@rAr
r
r�test_realpath_nul�szTestNtpath.test_realpath_nulzneed _getshortpathnamecCstt�tj�}t�|�t�|�t�|�|�tj|�t�	|d�}t�|�t
|�}t�	|d�}t�	|d�}t|d��}|�d�Wd�n1s�0Y|�
|t�|��t�|��"|�
|t�d��Wd�n1s�0Yt�|����"|�
|t�d��Wd�n1�s(0Yt�|��"|�
|t�d��Wd�n1�sf0YdS)NZMyVeryLongDirectoryNamezfile.txtrascontent)rrcrrdrhrurrtrgr{rrer�r7rjrv�lower)r6rlZ
test_dir_longZtest_dir_shortZtest_file_longZtest_file_shortr�r
r
r�test_realpath_cwd�s&



(02zTestNtpath.test_realpath_cwdcCs
t����}|��d|d<d|d<d|d<tdd�tdd	�td
d�tdd
�tdd�tdd�tdd�tdd�tdd�tdd�tdd�tdd	�tdd�tdd�tdd�td d!�td"d#�td$d%�td&d'�Wd�n1s�0YdS)(NrHr=Zbaz1z{fooZbaz2z{foo}zntpath.expandvars("foo")zntpath.expandvars("$foo bar")zbar barzntpath.expandvars("${foo}bar")Zbarbarzntpath.expandvars("$[foo]bar")z	$[foo]barzntpath.expandvars("$bar bar")z$bar barzntpath.expandvars("$?bar")z$?barzntpath.expandvars("$foo}bar")zbar}barzntpath.expandvars("${foo")z${foozntpath.expandvars("${{foo}}")zbaz1}zntpath.expandvars("$foo$foo")zntpath.expandvars("$bar$bar")z$bar$barzntpath.expandvars("%foo% bar")zntpath.expandvars("%foo%bar")zntpath.expandvars("%foo%%foo%")z$ntpath.expandvars("%%foo%%foo%foo%")z%foo%foobarzntpath.expandvars("%?bar%")z%?bar%zntpath.expandvars("%foo%%bar")zbar%barz ntpath.expandvars("'%foo%'%bar")z'%foo%'%barzntpath.expandvars("bar'%foo%")z	bar'%foo%)r�EnvironmentVarGuard�clearr3�r6�envr
r
r�test_expandvars�s0


















zTestNtpath.test_expandvarszneed support.FS_NONASCIIcCs�dd�}t����}|��tj}||d<d|||<|dd|�|d|d|�|dd	|�|d
|d|�|dd
|�|d|d|�|dd|�|d�|�d|�|dd	|�|d�|�d|�Wd�n1s�0YdS)NcSstd||�dS)Nzntpath.expandvars(%r)r@)�valuer\r
r
r�check�sz2TestNtpath.test_expandvars_nonascii.<locals>.check�spamZhamz	$spam barz%s barz$%s barz
${spam}barz%sbarz${%s}barzham%sbarz	$spam}barz%s}barz$%s}barz
%spam% barz%{}% barz	ham%s barz	%spam%barz%{}%bar)rr�r��FS_NONASCIIr
)r6r�r�Znonasciir
r
r�test_expandvars_nonascii�s 
z#TestNtpath.test_expandvars_nonasciicCs�tdd�t����}|��tdd�d|d<d|d<tdd	�td
d�|d=tdd�td
d�|��d|d
<tdd	�td
d�tdd�tdd�tdd�tdd�|��d|d<d|d
<tdd	�td
d�Wd�n1s�0YdS)Nzntpath.expanduser("test")�testzntpath.expanduser("~test")z~testz	eric\idle�HOMEPATH�C:\�	HOMEDRIVEzC:\eric\testzntpath.expanduser("~")zC:\eric\idlez	eric\test�USERPROFILEz"ntpath.expanduser("~test\foo\bar")zC:\eric\test\foo\barz"ntpath.expanduser("~test/foo/bar")zC:\eric\test/foo/barzntpath.expanduser("~\foo\bar")zC:\eric\idle\foo\barzntpath.expanduser("~/foo/bar")zC:\eric\idle/foo/barzF:\�HOME)r3rr�r�r�r
r
r�test_expanduser�s@








����
zTestNtpath.test_expanduserzabspath requires 'nt' modulecCs|tdd�t�tj��R}td|�td|d�td|d�t�|�\}}td|d	�Wd�n1sn0YdS)
Nzntpath.abspath("C:\")r�zntpath.abspath("")zntpath.abspath(" ")z\ zntpath.abspath("?")z\?zntpath.abspath("/abc/")z\abc)r3r�temp_cwdrdrrF)r6�cwd_dir�drive�_r
r
r�test_abspaths

zTestNtpath.test_abspathcCstdd�tdd�tdd�tdd�t�tj��>}t�|�}tdd	|d
�tdd	|d�Wd�n1sx0Ytd
d�tdd�tdd�tdd�tdd�tdd�tdd�tdd�tdd�tdd�td d�td!d�td"d�td#d�dS)$Nzntpath.relpath("a")rOz#ntpath.relpath(ntpath.abspath("a"))zntpath.relpath("a/b")r}zntpath.relpath("../a/b")z..\a\bzntpath.relpath("a", "../b")r~rPzntpath.relpath("a/b", "../c")z\a\bzntpath.relpath("a", "b/c")z..\..\az*ntpath.relpath("c:/foo/bar/bat", "c:/x/y")z..\..\foo\bar\batz@ntpath.relpath("//conky/mountpoint/a", "//conky/mountpoint/b/c")zntpath.relpath("a", "a")rUz(ntpath.relpath("/foo/bar/bat", "/x/y/z")z..\..\..\foo\bar\batz*ntpath.relpath("/foo/bar/bat", "/foo/bar")Zbatz#ntpath.relpath("/foo/bar/bat", "/")zfoo\bar\batz#ntpath.relpath("/", "/foo/bar/bat")rVz$ntpath.relpath("/foo/bar/bat", "/x")z..\foo\bar\batz$ntpath.relpath("/x", "/foo/bar/bat")z
..\..\..\xzntpath.relpath("/", "/")zntpath.relpath("/a", "/a")zntpath.relpath("/a/b", "/a/b")z"ntpath.relpath("c:/foo", "C:/FOO"))r3rr�rdrr)r6r�Z
currentdirr
r
r�test_relpaths,




0












zTestNtpath.test_relpathcsZdd�}�fdd�}��ttjg�|tddg�|tddg�|tddg�|tddg�|dgd�|ddgd�|d	dgd�|d	d	gd�|d
dgd�|dd
gd�|ddgd�|ddgd�|ddgd�|ddgd�|ddgd�|d	dgd�|ddgd�|ddgd�|ddgd�|tddg�|dgd�|ddgd�|ddgd�|ddgd�|ddgd�|dd gd�|gd!�d�|gd"�d�|d#d$gd%�|dgd�|dd&gd�|tdd'g���ttjd(dg���ttjd(d)g���ttjd*dg���ttjdd+g���ttjdd,g���ttjdd+g�dS)-NcSstd|�dd�|�dS)Nzntpath.commonpath(%r)r#r")r3r()�pathsr\r
r
rr�8s�z)TestNtpath.test_commonpath.<locals>.checkcs.��|tj|���|tjdd�|D��dS)NcSsg|]}t�|��qSr
)rr*rr
r
r�
<listcomp>>rzCTestNtpath.test_commonpath.<locals>.check_error.<locals>.<listcomp>)�assertRaisesr�
commonpath)�excr�rAr
r�check_error;s
�z/TestNtpath.test_commonpath.<locals>.check_errorzC:\Program Filesz
Program FileszC:Program Filesz\Program FileszC:\Program Files\zC:\\Program FileszC:\Program Files\\zC:\.\Program FileszC:\Program Files\.r�zC:\binzC:\Program Files\BarzC:\Program Files\FoozC:\ProjectszC:/Program Files/Barzc:/program files/barzc:\program fileszD:\Program Filesr��alotr?�and\jam�and\spam�andzand\\jamz
and\spam\\z	and\.\jamz
.\and\spam)r�r�r�)r�r�r�z	C:and\jamz
C:and\spamzC:andz	spam\alotz
\spam\alotsC:\Program FileszProgram Files\Foos
Program FilessC:\Program Files\FoosProgram Files\Foo)r��
ValueErrorrr��	TypeError)r6r�r�r
rAr�test_commonpath7s����������
�
�
�
�
�
�zTestNtpath.test_commonpathc
Cs�t���}t���}|�t�|��|����|�t�|��|����tjdkr�|�t	��t�dd�Wd�n1sz0YWd�n1s�0YWd�n1s�0YdS)N�win32���)
r�
assertTruer�sameopenfile�fileno�assertFalse�sys�platformr�r	)r6Ztf1Ztf2r
r
r�test_sameopenfile|s
zTestNtpath.test_sameopenfilecCs�|�t�d��|�t�d��|�t�d��|�t�d��|�t�d��|�t�d��|�t�d��|�t�d��|�t�d	��|�t�d
��|�t�d��|�t�d��t��� }|�t�|��Wd�n1s�0Ytjd
k�r�t�tj	�\}}t�
t�tj	���8|�t�|����|�t�|�
���Wd�n1�sf0Y|�t�d��|�t�d��|�t�d��|�t�d��dS)NrIr�rJzC:/z\\.\c:\z\\.\C:\sc:\sC:\sc:/sC:/s\\.\c:\s\\.\C:\r�z\\localhost\c$z\\localhost\c$\s\\localhost\c$s\\localhost\c$\)r�r�ismountrZtemp_dirr�r�r�rF�
executablervr^r��upper)r6�dr�rr
r
r�test_ismount�s.
.4zTestNtpath.test_ismountcCs|�|��|���dSr)r5r�)r6�s1�s2r
r
r�
assertEqualCI�szTestNtpath.assertEqualCIzOS helpers require 'nt' modulecCst�tj�}|t�|�fD]6}t�|�}t�|�d}t�|�d}|�	||�qt�
tj�\}}|�|d�|�|d�t�
tj�
��\}}	|�||�|�|	d�tjtjfD]T}t�|�}
|�|
t�|�t|
�d�t�|�
��}|�|t�|�t|�d�q�dS)Nr)�nt�_getfinalpathnamer�r�rr*�_getvolumepathnamerrFr�Z
_getdiskusage�exec_prefixZ
assertGreaterr,r5�prefixZassertIsInstancer�lenr)r6r�rZvolume_path�
path_driveZvolume_path_driveZcap�freeZb_capZb_freeZ
final_pathZb_final_pathr
r
r�test_nt_helpers�s&

zTestNtpath.test_nt_helpersN)%r9r:r;rBrGrKrMrNrSrXr]r_rZskip_unless_symlink�unittestZ
skipUnless�HAVE_GETFINALPATHNAMErmrorxr�r�r��HAVE_GETSHORTPATHNAMEr�r�r�r�r�r�r�r�r�r�r�r�r�r
r
r
rr<UsTA

	
7
,
 




$

	E
#
r<c@seZdZeZdgZdS)�NtCommonTestrnN)r9r:r;rZ
pathmoduleZ
attributesr
r
r
rr��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)d*�Zd+S),�
PathLikeTestscCs`tj|_ttj�|_|�tj|j�t|jdd��}|�d�Wd�n1sR0YdS)N�xbrstest_ntpath.PathLikeTests)	rrd�	file_namer�	file_pathrgrhrer�)r6�filer
r
r�setUp�s
zPathLikeTests.setUpcCs|�||j�||j��dSr)r7r�r�)r6�funcr
r
r�_check_function�szPathLikeTests._check_functioncCs|�|jj�dSr)r�rrrAr
r
r�test_path_normcase�sz PathLikeTests.test_path_normcasecCs|�|jj�dSr)r�r�isabsrAr
r
r�test_path_isabs�szPathLikeTests.test_path_isabscCs,|�|j�dtd�d�|j�ddd��dS)NrO�brz)r5rr{rrAr
r
r�test_path_join�s�zPathLikeTests.test_path_joincCs|�|jj�dSr)r�r�splitrAr
r
r�test_path_split�szPathLikeTests.test_path_splitcCs|�|jj�dSr)r�r�splitextrAr
r
r�test_path_splitext�sz PathLikeTests.test_path_splitextcCs|�|jj�dSr)r�rrFrAr
r
r�test_path_splitdrive�sz"PathLikeTests.test_path_splitdrivecCs|�|jj�dSr)r�rrrAr
r
r�test_path_basename�sz PathLikeTests.test_path_basenamecCs|�|jj�dSr)r�rr^rAr
r
r�test_path_dirname�szPathLikeTests.test_path_dirnamecCs|�|jj�dSr)r�r�islinkrAr
r
r�test_path_islink�szPathLikeTests.test_path_islinkcCs|�|jj�dSr)r�r�lexistsrAr
r
r�test_path_lexists�szPathLikeTests.test_path_lexistscCs|�|jj�dSr)r�rr�rAr
r
r�test_path_ismountszPathLikeTests.test_path_ismountcCs|�|jj�dSr)r�r�
expanduserrAr
r
r�test_path_expandusersz"PathLikeTests.test_path_expandusercCs|�|jj�dSr)r�r�
expandvarsrAr
r
r�test_path_expandvarssz"PathLikeTests.test_path_expandvarscCs|�|jj�dSr)r�rrYrAr
r
r�test_path_normpath	sz PathLikeTests.test_path_normpathcCs|�|jj�dSr)r�rrcrAr
r
r�test_path_abspathszPathLikeTests.test_path_abspathcCs|�|jj�dSr)r�rrjrAr
r
r�test_path_realpathsz PathLikeTests.test_path_realpathcCs|�|jj�dSr)r�rrnrAr
r
r�test_path_relpathszPathLikeTests.test_path_relpathcCs&|j�|j|jg�}|�||j�dSr)rr�r�r�r7)r6Zcommon_pathr
r
r�test_path_commonpathsz"PathLikeTests.test_path_commonpathcCs|�|jj�dSr)r�r�isdirrAr
r
r�test_path_isdirszPathLikeTests.test_path_isdirN)r9r:r;rrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r
r
rr��s,r��__main__)rrr�r�r-Ztest.supportrrr�rr�tempfilerr��ImportErrorr��AttributeErrorr�rr�rr!r3ZTestCaser4r<Z
CommonTestr�r�r9�mainr
r
r
r�<module>sD




}J


Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists