
    <e                        d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlmZm	Z	 d dl
mZ d dlmZ d dlmZ 	 d dlZn# e$ r dZY nw xY w	 e j         dZn# e$ r dZY nw xY w	 d dlZdZd	 Zn# e$ r dZY nw xY wd
 Zd Z G d dej                  Z G d de          Z G d dej        ej                  Z G d de          Ze dk    r ej!                     dS dS )    N)	os_helper)
TestFailedis_emscripten)FakePath)test_genericpath)TemporaryFileTFc                    t          j        dd          j        }t           j        t           j        t           j        g|_        t           j        |_         || d d          }|s3t          d                    t          j	                                        t          j
        |          } || ||          }|d |         S )Nkernel32T)use_last_errorr   z&failed to get short path name 0x{:08X})ctypesWinDLLGetShortPathNameW	c_wchar_pc_uint32argtypesrestypeOSErrorformatget_last_errorcreate_unicode_buffer)pathGSPN
result_lenresults       '/usr/lib/python3.11/test/test_ntpath.py_getshortpathnamer   "   s    }Z===O)6+;V_MT$a((
 	<B!6&"7"9"9::< < <-j99T$
33
kzk""    c                     t          | t          t          t          j        f          r&t          j        t          j        |                     S t          | d          rt          d | D                       S | S )N__iter__c              3   b   K   | ]*}t          j        t          j        |                    V  +d S N)ntpathnormcaseosfsdecode.0ps     r   	<genexpr>z_norm.<locals>.<genexpr>2   s4      CCV_R[^^44CCCCCCr   )

isinstancebytesstrr$   PathLiker"   r#   r%   hasattrtuple)r   s    r   _normr0   .   sm    $R[122 Dr{400111	z	"	" DCCdCCCCCCKr   c           	      $   |                      dd          } t          |           }||k    r^t          |          t          |          k    r>t          t	          |           dt	          |          dt	          |                    |                      dd          } |                      dd          } |                      d	d
          } |                      dd          } |                      dd          } |                      dd          } t          j        |                               d          } |                     dd                              d          } t          j
                    5  t          j        dt                     t          |           }d d d            n# 1 swxY w Y   t          |          t          |          k    r>t          t	          |           dt	          |          dt          |                    d S )N\\\z should return: z but returned: z('z(b'z("z(b"z['z[b'z["z[b"z, 'z, b'z, "z, b"latin1asciibackslashreplaceignore)replaceevalr0   r   r,   r$   fsencodedecodeencodewarningscatch_warningssimplefilterDeprecationWarningrepr)fn
wantResult	gotResults      r   testerrE   6   s   	D&	!	!BRIY5#4#4i8H8H#H#HBZ#i...: ; ; 	; 
D%	 	 B	D%	 	 B	D%	 	 B	D%	 	 B	E6	"	"B	E6	"	"B	R			)	)B	7.	/	/	6	6w	?	?B		 	"	"  h(:;;;HH	               ZE),,,,BZ$y///; < < 	< -,s   1*F''F+.F+c                       e Zd Zd Zd ZdS )NtpathTestCasec                     ||k    s t          |          t          |          k    rd S |                     ||           d S r!   )r0   assertEqual)selfpath1path2s      r   assertPathEqualzNtpathTestCase.assertPathEqualO   sB    E>>U5\\U5\\99F&&&&&r   c                 f    |                      t          |          t          |                     d S r!   )assertInr0   )rJ   r   pathsets      r   assertPathInzNtpathTestCase.assertPathInT   s(    eDkk5>>22222r   N)__name__
__module____qualname__rM   rQ    r   r   rG   rG   N   s2        ' ' '
3 3 3 3 3r   rG   c                      e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zej         ej        ed
          d                         Zej         ej        ed
          d                         Zej         ej        ed
          d                         Zej         ej        ed
          d                         Zej         ej        ed
          d                         Zej         ej        ed
          d                         Zej         ej        ed
          d                         Z ej        ed
          d             Z ej        ed
           ej        ed          d                         Zd Z ej        ej        d          d             Zd Z ej        ed          d             Z d Z!d Z" ej#        e$d          d             Z%d Z&d  Z' ej        ed!          d"             Z(d#S )$
TestNtpathc                 F   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ntpath.splitext("foo.ext"))foo.extzntpath.splitext("/foo/foo.ext"))z/foo/foorZ   zntpath.splitext(".ext"))rZ    zntpath.splitext("\foo.ext\foo"))z\foo.ext\foor[   zntpath.splitext("foo.ext\"))zfoo.ext\r[   zntpath.splitext(""))r[   r[   zntpath.splitext("foo.bar.ext"))zfoo.barrZ   z!ntpath.splitext("xx/foo.bar.ext"))z
xx/foo.barrZ   z!ntpath.splitext("xx\foo.bar.ext"))z
xx\foo.barrZ   zntpath.splitext("c:a/b\c.d"))zc:a/b\cz.drE   rJ   s    r   test_splitextzTestNtpath.test_splitextY   s    +_===02FGGG(,77724JKKK-/@AAA$h////1DEEE24JKKK35LMMM.0BCCCCCr   c                 v   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          j        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,           t          d-d.           t          d/d0           t          d1d2           t          d3d4           t          d5d6           t          d7d8           t          d9d:           t          d;d<           t          d=d>           t          d?d@           t          dAdB           t          dCdD           d S )ENzntpath.splitdrive("c:\foo\bar"))c:\foo\barzntpath.splitdrive("c:/foo/bar"))r`   /foo/barz/ntpath.splitdrive("\\conky\mountpoint\foo\bar"))z\\conky\mountpointra   z/ntpath.splitdrive("//conky/mountpoint/foo/bar"))z//conky/mountpointrb   z0ntpath.splitdrive("\\\conky\mountpoint\foo\bar"))z\\\conky\mountpoint\foo\barz0ntpath.splitdrive("///conky/mountpoint/foo/bar"))z///conky/mountpoint/foo/barz0ntpath.splitdrive("\\conky\\mountpoint\foo\bar"))z\\conky\rc   z0ntpath.splitdrive("//conky//mountpoint/foo/bar"))z//conky/rd   u   //conky/MOUNTPOİNT/foo/bar)u   //conky/MOUNTPOİNTrb   zntpath.splitdrive("//?/c:"))//?/c:r[   zntpath.splitdrive("//?/c:/"))re   /zntpath.splitdrive("//?/c:/dir"))re   /dirzntpath.splitdrive("//?/UNC"))z//?/UNCr[   zntpath.splitdrive("//?/UNC/"))z//?/UNC/r[   z$ntpath.splitdrive("//?/UNC/server/"))z//?/UNC/server/r[   z)ntpath.splitdrive("//?/UNC/server/share"))//?/UNC/server/sharer[   z-ntpath.splitdrive("//?/UNC/server/share/dir"))rh   rg   zJntpath.splitdrive("//?/VOLUME{00000000-0000-0000-0000-000000000000}/spam"))z0//?/VOLUME{00000000-0000-0000-0000-000000000000}z/spamz'ntpath.splitdrive("//?/BootPartition/"))z//?/BootPartitionrf   zntpath.splitdrive("\\?\c:"))\\?\c:r[   zntpath.splitdrive("\\?\c:\"))ri   r2   zntpath.splitdrive("\\?\c:\dir"))ri   \dirzntpath.splitdrive("\\?\UNC"))z\\?\UNCr[   zntpath.splitdrive("\\?\UNC\"))z\\?\UNC\r[   z$ntpath.splitdrive("\\?\UNC\server\"))z\\?\UNC\server\r[   z)ntpath.splitdrive("\\?\UNC\server\share"))\\?\UNC\server\sharer[   z-ntpath.splitdrive("\\?\UNC\server\share\dir"))rk   rj   zJntpath.splitdrive("\\?\VOLUME{00000000-0000-0000-0000-000000000000}\spam"))z0\\?\VOLUME{00000000-0000-0000-0000-000000000000}z\spamz'ntpath.splitdrive("\\?\BootPartition\"))z\\?\BootPartitionr2   zntpath.splitdrive("//"))z//r[   zntpath.splitdrive("///"))z///r[   zntpath.splitdrive("///y"))z///yr[   zntpath.splitdrive("//x"))z//xr[   zntpath.splitdrive("//x/"))z//x/r[   )rE   rI   r"   
splitdriver]   s    r   test_splitdrivezTestNtpath.test_splitdrivee   s   2#	% 	% 	%0!	# 	# 	#E6	8 	8 	8@1	3 	3 	3G5	7 	7 	7A/	1 	1 	1G8	: 	: 	:A2	4 	4 	4 	*+HII<	> 	> 	> 	,n===-???02DEEE-???.0@AAA57NOOO:<XYYY>@`aaa[L	N 	N 	N8:TUUU/1BCCC13FGGG46LMMM02DEEE24HIII:<XYYY?AbcccD5	7 	7 	7_P	R 	R 	R<>\]]] 	(*555);777*L999);777*L99999r   c                     t          dd           t          dd           t          dd           t          dd           t          d	d
           t          dd           d S )Nzntpath.split("c:\foo\bar"))zc:\foobarz*ntpath.split("\\conky\mountpoint\foo\bar"))z\\conky\mountpoint\fooro   zntpath.split("c:\"))c:\r[   z#ntpath.split("\\conky\mountpoint\"))z\\conky\mountpoint\r[   zntpath.split("c:/"))c:/r[   z#ntpath.split("//conky/mountpoint/"))z//conky/mountpoint/r[   r\   r]   s    r   
test_splitzTestNtpath.test_split   s    -/ABBB@4	6 	6 	6 	%|4448.	0 	0 	0 	$k22246QRRRRRr   c                     t          dd           t          dd           t          dd           t          dd           t          dd           t          dd           d S )Nzntpath.isabs("c:\")   z#ntpath.isabs("\\conky\mountpoint\")zntpath.isabs("\foo")zntpath.isabs("\foo\bar")z"ntpath.isabs("\\conky\mountpoint")zntpath.isabs("\\.\C:")r\   r]   s    r   
test_isabszTestNtpath.test_isabs   sp    %q)))8!<<<&***+Q/// 	6:::*A.....r   c                 f    t          dd           t          dd           t          dd           d S )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\   r]   s    r   test_commonprefixzTestNtpath.test_commonprefix   sT    O	 	 	R	! 	! 	!L 	" 	" 	" 	" 	"r   c           	         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           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/d0           t          d1d2           t          d3d4           t          d5d6           t          d7d8           t          d9d:           t          d;d<           t          d=d<           t          d>d0           t          d?d0           t          d@d0           t          dAd0           t          dBd8           t          dCd8           t          dDd8           t          dEdF           t          dGdH           t          dIdJ           t          dKdL           dMD ]}dND ]}t          dO|dP|dQ|           t          dRdS           t          dTdS           t          dUdS           t          dVdW           t          dXdY           t          dZd[           d S )\Nzntpath.join("")r[   zntpath.join("", "", "")zntpath.join("a")azntpath.join("/a")z/azntpath.join("\a")\azntpath.join("a:")za:zntpath.join("a:", "\b")za:\bzntpath.join("a", "\b")z\bzntpath.join("a", "b", "c")za\b\czntpath.join("a\", "b", "c")zntpath.join("a", "b\", "c")zntpath.join("a", "b", "\c")z\czntpath.join("d:\", "\pleep")zd:\pleepzntpath.join("d:\", "a", "b")zd:\a\bzntpath.join('', 'a')z ntpath.join('', '', '', '', 'a')zntpath.join('a', '')za\z ntpath.join('a', '', '', '', '')zntpath.join('a\', '')z!ntpath.join('a\', '', '', '', '')zntpath.join('a/', '')za/zntpath.join('a/b', 'x/y')za/b\x/yzntpath.join('/a/b', 'x/y')z/a/b\x/yzntpath.join('/a/b/', 'x/y')z/a/b/x/yzntpath.join('c:', 'x/y')zc:x/yzntpath.join('c:a/b', 'x/y')z	c:a/b\x/yzntpath.join('c:a/b/', 'x/y')z	c:a/b/x/yzntpath.join('c:/', 'x/y')zc:/x/yzntpath.join('c:/a/b', 'x/y')z
c:/a/b\x/yzntpath.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/yzntpath.join('a/b', '/x/y')z/x/yzntpath.join('/a/b', '/x/y')zntpath.join('c:', '/x/y')zntpath.join('c:a/b', '/x/y')zntpath.join('c:/', '/x/y')zntpath.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')zntpath.join('c:', 'C:x/y')zC:x/yzntpath.join('c:a/b', 'C:x/y')z	C:a/b\x/yzntpath.join('c:/', 'C:x/y')zC:/x/yzntpath.join('c:/a/b', 'C:x/y')z
C:/a/b\x/y)
r[   za/bz/a/br`   zc:a/brq   zc:/a/bz//computer/sharez//computer/share/z//computer/share/a/b)zd:zd:x/yzd:/zd:/x/yz//machine/commonz//machine/common/z//machine/common/x/yzntpath.join(z, )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\   )rJ   xys      r   	test_joinzTestNtpath.test_join   s    "%%%("---!3'''"D)))#U+++"D))))7333(%000+Y777-y999-y999-u555/===.
;;;%s+++13777%u---15999'///3U;;;&---*J777+[999,j999)7333,l;;;-{;;;*H555-}===.===79PQQQ8:PQQQ;=XYYY+V444,f555*H555-x888+X666.9998:PQQQ9;QRRR:<RSSS+W555.===,h777/???S 	: 	:AW : :1115q9999: 	?A\]]]=?Z[[[;=XYYY;=TUUU:<TUUU79PQQQQQr   c                 F   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           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          d0d1           t          d2d1           t          d3d1           t          d4d1           t          d5d6           t          d7d8           t          d9d:           t          d;d<           d S )=Nz$ntpath.normpath('A//////././//.//B')zA\Bzntpath.normpath('A/./B')zntpath.normpath('A/foo/../B')zntpath.normpath('C:A//B')zC:A\Bzntpath.normpath('D:A/./B')zD:A\Bzntpath.normpath('e:A/foo/../B')ze:A\Bzntpath.normpath('C:///A//B')zC:\A\Bzntpath.normpath('D:///A/./B')zD:\A\Bz"ntpath.normpath('e:///A/foo/../B')ze:\A\Bzntpath.normpath('..')..zntpath.normpath('.').zntpath.normpath('')zntpath.normpath('/')r2   zntpath.normpath('c:/')rp   zntpath.normpath('/../.././..')zntpath.normpath('c:/../../..')zntpath.normpath('../.././..')..\..\..zntpath.normpath('K:../.././..')z
K:..\..\..zntpath.normpath('C:////a/b')zC:\a\bz'ntpath.normpath('//machine/share//a/b')z\\machine\share\a\bzntpath.normpath('\\.\NUL')\\.\NULzntpath.normpath('\\?\D:/XY\Z')z\\?\D:/XY\Zz1ntpath.normpath('handbook/../../Tests/image.png')z..\Tests\image.pngz4ntpath.normpath('handbook/../../../Tests/image.png')z..\..\Tests\image.pngz.ntpath.normpath('handbook///../a/.././../b/c')z..\b\cz/ntpath.normpath('handbook/a/../..///../../b/c')z	..\..\b\cz$ntpath.normpath('//server/share/..')\\server\share\z%ntpath.normpath('//server/share/../')z'ntpath.normpath('//server/share/../..')z(ntpath.normpath('//server/share/../../')zntpath.normpath('\\foo\\')z\\foo\\zntpath.normpath('\\foo\')z\\foo\zntpath.normpath('\\foo')z\\foozntpath.normpath('\\')r3   r\   r]   s    r   test_normpathzTestNtpath.test_normpath   sS   5v>>>)6222.777*H555+X6660(;;;-y999.	:::3Y???&...%t,,,$d+++%t,,,'000/666/888.<<<0-@@@-y9998:PQQQ.
;;;3^DDDBDYZZZEG_```?KKK@,OOO5;PQQQ6;PQQQ8;PQQQ9;PQQQ 	/???-{;;;+Y777(&11111r   c                     t          j        t          j                              }t	          d|           t	          d|           t	          d|           t	          d|           t	          d|           d S )Nzntpath.realpath('.')zntpath.realpath('./.')z&ntpath.realpath('/'.join(['.'] * 100))zntpath.realpath('.\.')z&ntpath.realpath('\'.join(['.'] * 100)))r"   normpathr$   getcwdrE   rJ   expecteds     r   test_realpath_curdirzTestNtpath.test_realpath_curdir$  sr    ?29;;//%x000'2227BBB((3338(CCCCCr   c                    t          j        t          j                              }t	          dt          j        |                     t	          dt          j        t          j        |                               t	          dt          j        |          d         dz              t	          dt          j        t          j        |                               t	          dt          j        |          d         dz              d S )Nzntpath.realpath('..')zntpath.realpath('../..')z&ntpath.realpath('/'.join(['..'] * 50))r   r2   zntpath.realpath('..\..')z&ntpath.realpath('\'.join(['..'] * 50)))r"   r   r$   r   rE   dirnamerl   r   s     r   test_realpath_pardirzTestNtpath.test_realpath_pardir,  s    ?29;;//&x(@(@AAA)~fnX6677	9 	9 	97 **1-4	6 	6 	6*~fnX6677	9 	9 	98 **1-4	6 	6 	6 	6 	6r   zneed _getfinalpathnamec                 f   t          j        t          j                  }t	          |d                                           |                     t          j        |           |                     t          j        |dz              t          j	        ||dz              | 
                    t          j        |dz             |           | 
                    t          j        t          j        |dz                       t          j        |                     t          j        D ]}| d}t          j        |          s nt!          d          |                     t          j        |          |           |                     |dz   t          j        t          j        dz   d                     d S )Nwb1z:\zNo free drive letters available spamFstrict)r"   abspathr   TESTFNopenclose
addCleanupunlinkr$   symlinkrM   realpathr:   stringascii_uppercaseexistsr   rI   )rJ   ABSTFNcds       r   test_realpath_basiczTestNtpath.test_realpath_basic8  s    	 011VT  """	(&111	(&3,777

66C<(((V_Vc\::FCCCV_R[#-F-FGGV,,	. 	. 	.
 ' 	= 	=A			A=##  ;<<<++Q/// 	(*)9H)DUSSS	U 	U 	U 	U 	Ur   c                    t          j        t          j                  }t	          j        |dz   |           |                     t          j        |           |                     t          t           j
        |d           |                     t          t           j
        |dz   d           |                     t          t           j
        |dz   d           d S )Nr   Tr   2r   )r"   r   r   r   r$   r   r   r   assertRaisesFileNotFoundErrorr   r   rJ   r   s     r   test_realpath_strictzTestNtpath.test_realpath_strictS  s    
 	 011

6C<(((	(&111+V_fTRRR+V_fslSWXXX'6?FX4EdSSSSSr   c                    t          j        t          j                  }t	          |d                                           |                     t          j        |           |                     t          j        |dz              t          j	        |t          j
        |dz                        |                     t          j        |dz             |           d S )Nr   r   )r"   r   r   r   r   r   r   r   r$   r   relpathrM   r   r   s     r   test_realpath_relativez!TestNtpath.test_realpath_relative`  s     	 011VT  """	(&111	(&3,777

66>&3,77888V_Vc\::FCCCCCr   c                 |	   t          j        t          j                  }t	          j        |           |                     t          j        |           t          j        |          5  t	          j        d           t	          j	        d           t	          j
        dd           t	          j
        dd           t	          j	        d           t	          j
        dd           t	          j
        dd           t	          j
        d	d
           t	          j
        dd           t	          j
        dd           t	          j
        |dz   d           t	          j
        dd           |                     t          j        d          |dz              |                     t          j        d          |dz              |                     t          j        d
          |dz              |                     t          j        d          |dz              |                     t          j        d          |dz              |                     t          j        d          |dz              |                     t          j        d          |dz              |                     t          j        d          |dz              |                     t          j        d          t	          j        |dz                        |                     t          j        d          t	          j        |dz                        |                     t          j        d          t	          j        |dz                        |                     t          j        d          t	          j        |dz                        |                     t          j        d          t	          j        |dz                        |                     t          j        d           t	          j        |dz                        |                     t          j        d!          t	          j        |dz                        |                     t          j        d"          t	          j        |dz                        d d d            d S # 1 swxY w Y   d S )#Nsubdirr   	recursiver   parentrJ   missingbrokenz
broken\barbroken1zself\self\brokenbroken2z"subdir\parent\subdir\parent\brokenbroken3z\brokenbroken4zrecursive\..\brokenbroken5z\missingz
broken\fooz\missing\fooz\broken\barzbroken1\bazz\broken\bar\bazz\self\self\missingz$\subdir\parent\subdir\parent\missings   brokens
   broken\foos   broken1s   broken1\bazs   broken2s   broken3s   broken4s   broken5)r"   r   r   r   r$   mkdirr   rmtree
change_cwdchdirr   rM   r   r:   r   s     r   test_realpath_broken_symlinksz(TestNtpath.test_realpath_broken_symlinksk  s    	 011
	(&111!&)) 0	D 0	DHXHXJsK(((JtX&&&HTNNNJsF###Jy(+++J}i000J*I666J<iHHHJv
*I666J-y999  !:!:!'+!57 7 7  !?!?!'/!9; ; ;   !<!<!'.!8: : :  !@!@!'*<!<> > >  !;!;!'*?!?A A A  !;!;!'*Q!QS S S  !;!;!'+!57 7 7  !;!;!'+!57 7 7   !;!;!#Vk-A!B!BD D D  !@!@!#Vo-E!F!FH H H  !=!=!#Vn-D!E!EG G G  !A!A!#V6H-H!I!IK K K  !<!<!#V6K-K!L!LN N N  !=!=!#V6]-]!^!^` ` `  !<!<!#Vk-A!B!BD D D  !<!<!#Vk-A!B!BD D D_0	D 0	D 0	D 0	D 0	D 0	D 0	D 0	D 0	D 0	D 0	D 0	D 0	D 0	D 0	D 0	D 0	D 0	Ds   'P=R11R58R5c                 l   t          j        t          j                  }|                     t          j        |           |                     t          j        |dz              |                     t          j        |dz              |                     t          j        |dz              |                     t          j        |dz              |                     t          j        |dz              t          j        ||           |                     t          j	        |          |           t          j        |dz   |dz              t          j        |dz   |dz              |dz   |dz   f}| 
                    t          j	        |dz             |           | 
                    t          j	        |dz             |           | 
                    t          j	        |dz             d |D                        |                     t          j	        |dz             t          j        |                     |                     t          j	        |d	z             t          j        |          d
z              t          j        |dz   |dz              |                     t          j	        |dz   t          j        |          z   dz             |dz              | 
                    t          j	        |dz   t          j        |          z   dz             |           t          j        t          j        |          dz   |dz              |                     t          j	        |dz             |dz              t          j        dt          j        t          j        |                    z   dz   t          j        |          z   dz   |dz              |                     t          j	        |dz             |dz              |                     t          j	        t          j        |                    |           d S )Nr   r   r}   r   ry   1\xc              3   @   K   | ]}t          j        |d           V  dS )r|   N)r"   join)r'   rs     r   r)   z9TestNtpath.test_realpath_symlink_loops.<locals>.<genexpr>  s.      AA16;q#..AAAAAAr   1\..1\..\xz\xr|   1\..\a\b..\r2   )r"   r   r   r   r   r   r$   r   rM   r   rQ   r   basename)rJ   r   r   s      r   test_realpath_symlink_loopsz&TestNtpath.test_realpath_symlink_loops  s    	 011	(&111	(&3,777	(&3,777	(&3,777	(&3,777	(&3,777

66"""V_V44f===

6C<#...

6C<#...SL&3,/&/&3,77BBB&/&3,77BBB&/&6/::AAAAA	C 	C 	CV_Vg-=>>#^F33	5 	5 	5V_Vj-@AA#^F33e;	= 	= 	=

6C<#...V_Vi-?/5v/F/F.GIL.M N N#c\	+ 	+ 	+ 	&/&9*<,2OF,C,C+DFI+J K K"	$ 	$ 	$ 	
6?6**V3Vc\BBBV_Vc\::FSLIII

6FOFN6,B,BCCC"OF33469:;AC<	I 	I 	IV_Vc\::FSLIII 	V_V_V-D-DEEvNNNNNr   c                    t          j        t          j                  }|                     t          j        |           |                     t          j        |dz              |                     t          j        |dz              |                     t          j        |dz              |                     t          j        |dz              |                     t          j        |dz              t          j        ||           |                     t          t           j
        |d           t          j        |dz   |dz              t          j        |dz   |dz              |                     t          t           j
        |dz   d           |                     t          t           j
        |dz   d           |                     t          t           j
        |dz   d           |                     t          j
        |d	z   d          t          j        |                     |                     t          t           j
        |d
z   d           t          j        |dz   |dz              |                     t          t           j
        |dz   t          j        |          z   dz   d           |                     t          t           j
        |dz   t          j        |          z   dz   d           t          j        t          j        |          dz   |dz              |                     t          t           j
        |dz   d           t          j        dt          j        t          j        |                    z   dz   t          j        |          z   dz   |dz              |                     t          t           j
        |dz   d           |                     t          t           j
        t          j        |          d           d S )Nr   r   r}   r   ry   Tr   r   r   r   r|   r   r   r   r2   )r"   r   r   r   r   r   r$   r   r   r   r   rM   r   r   r   s     r   "test_realpath_symlink_loops_strictz-TestNtpath.test_realpath_symlink_loops_strict  s    	 011	(&111	(&3,777	(&3,777	(&3,777	(&3,777	(&3,777

66"""'6?F4HHH

6C<#...

6C<#...'6?FSLNNN'6?FSLNNN'6?FVODQQQ 	V_Vg-=dKKK#^F33	5 	5 	5'6?FZ4GPTUUU

6C<#...'6?FY4F/5v/F/F5GIL5M48 	 	: 	: 	: 	'6? 9,vv/F/FFL!% 	 	' 	' 	' 	
6?6**V3Vc\BBB'6?FSLNNN

6FOFN6,B,BCCC"OF33469:;AC<	I 	I 	I'6?FSLNNN 	'6?FOF4K4K!% 	 	' 	' 	' 	' 	'r   c                    t          j        t          j                  }|                     t          j        |dz              |                     t          j        d|z   dz              |                     t          j        |dz              |                     t          j        |dz              t          |dz   d          5 }|                    d           d d d            n# 1 swxY w Y   t          j	        |dz   |dz              t          d|z   dz   d          5 }|                    d           d d d            n# 1 swxY w Y   t          j	        d|z   dz   |dz              | 
                    t          j        |dz             |dz              | 
                    t          j        |dz             d|z   dz              t          t          j        |dz             d	          5 }|                     |                                d           d d d            n# 1 swxY w Y   t          t          j        |dz             d	          5 }|                     |                                d           d d d            n# 1 swxY w Y   | 
                    t          j        d|z   dz             d|z   dz              | 
                    t          j        d|z   dz             d|z   dz              d S )
N3z\\?\z3.3linkz3.linkr      0   1rb)r"   r   r   r   r   r   r   writer$   r   rM   r   rI   read)rJ   r   fs      r   test_realpath_symlink_prefixz'TestNtpath.test_realpath_symlink_prefix  s    	 011	(&3,777	()f*<t*CDDD	(&7*:;;;	(&8*;<<<&3,%% 	GGDMMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	

6C<'!1222)f$t+T22 	aGGDMMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	

9v%,fx.?@@@V_Vg-=>>#c\	+ 	+ 	+V_Vh->??&/$6	8 	8 	8 &/&7"233T:: 	-aQVVXXt,,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-&/&8"344d;; 	-qQVVXXt,,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	V_Y-?'-IJJ&/#5	7 	7 	7V_Y-?(-JKK&/$6	8 	8 	8 	8 	8sH   C##C'*C'EEE.)H##H'*H')JJJc                 &    t          dd           d S )Nzntpath.realpath('NUL')r   r\   r]   s    r   test_realpath_nulzTestNtpath.test_realpath_nul!  s    '44444r   zneed _getshortpathnamec                    t          j        t          j                  }t          j        |           t          j        |           t          j        |           |                     t          j        |           t          j	        |d          }t          j        |           t          |          }t          j	        |d          }t          j	        |d          }t          |d          5 }|                    d           d d d            n# 1 swxY w Y   |                     |t          j        |                     t          j        |          5  |                     |t          j        d                     d d d            n# 1 swxY w Y   t          j        |                                          5  |                     |t          j        d                     d d d            n# 1 swxY w Y   t          j        |          5  |                     |t          j        d                     d d d            d S # 1 swxY w Y   d S )NMyVeryLongDirectoryNamezfile.txtr   s   content)r"   r   r   r   r   r   r$   r   r   r   r   r   r   rM   r   r   lower)rJ   r   test_dir_longtest_dir_shorttest_file_longtest_file_shortr   s          r   test_realpath_cwdzTestNtpath.test_realpath_cwd%  s)    	 011      
	(&111F,EFF
*=99]J?? +njAA.$'' 	 1GGJ	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	^V__-M-MNNN!-00 	N 	N  1L1LMMM	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N!-"5"5"7"788 	N 	N  1L1LMMM	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N!.11 	N 	N  1L1LMMM	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	NsH   -DDD)FFF<)G11G58G5)II
I
c                    t          j                    5 }|                                 d|d<   d|d<   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           t          dd           t          dd           t          d d!           t          d"d#           t          d$d%           t          d&d'           d d d            d S # 1 swxY w Y   d S )(Nro   rY   baz1z{foobaz2z{foo}zntpath.expandvars("foo")zntpath.expandvars("$foo bar")zbar barzntpath.expandvars("${foo}bar")barbarzntpath.expandvars("$[foo]bar")z	$[foo]barzntpath.expandvars("$bar bar")z$bar barzntpath.expandvars("$?bar")z$?barzntpath.expandvars("$foo}bar")zbar}barzntpath.expandvars("${foo")z${foozntpath.expandvars("${{foo}}")zbaz1}zntpath.expandvars("$foo$foo")zntpath.expandvars("$bar$bar")z$bar$barzntpath.expandvars("%foo% bar")zntpath.expandvars("%foo%bar")zntpath.expandvars("%foo%%foo%")z$ntpath.expandvars("%%foo%%foo%foo%")z%foo%foobarzntpath.expandvars("%?bar%")z%?bar%zntpath.expandvars("%foo%%bar")zbar%barz ntpath.expandvars("'%foo%'%bar")z'%foo%'%barzntpath.expandvars("bar'%foo%")z	bar'%foo%)r   EnvironmentVarGuardclearrE   rJ   envs     r   test_expandvarszTestNtpath.test_expandvarsB  s   *,, 	DIIKKKCJ CK!CL-u5552I>>>3X>>>3[AAA2J???/9992I>>>/9992G<<<2H===2J???3Y???2H===4h???9=III0(;;;3Y???7III4lCCC/	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	Ds   EE55E9<E9zneed os_helper.FS_NONASCIIc                 H   d }t          j                    5 }|                                 t           j        }||d<   d|z   ||<    |dd|z              |d|z  d|z              |dd|z              |d	|z  d
|z              |dd|z              |d|z  d|z              |dd|z              |d                    |          d|z              |dd|z              |d                    |          d
|z             d d d            d S # 1 swxY w Y   d S )Nc                 ,    t          d| z  |           d S )Nzntpath.expandvars(%r)r\   )valuer   s     r   checkz2TestNtpath.test_expandvars_nonascii.<locals>.check^  s    *U2H=====r   spamhamz	$spam barz%s barz$%s barz
${spam}barz%sbarz${%s}barzham%sbarz	$spam}barz%s}barz$%s}barz
%spam% barz%{}% barz	ham%s barz	%spam%barz%{}%bar)r   r   r   FS_NONASCIIr   )rJ   r   r   nonasciis       r   test_expandvars_nonasciiz#TestNtpath.test_expandvars_nonascii\  s   	> 	> 	>*,, 	EIIKKK ,H"CK!H,CME+x(2333E)h&	H(<===E,( 2333E*x'h)>???E+x(2333E)h&	H(<===E,8 3444E*##H--{X/EFFFE+w1222E)""8,,j8.CDDD	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	Es   C3DDDc                 h   t          dd           t          j                    5 }|                                 t          dd           d|d<   d|d<   d	|d
<   t          dd           t          dd           |d= t          dd           t          dd           |                                 d|d<   d	|d
<   t          dd           t          dd           t          dd           t          dd           t          dd           t          dd           |                                 d|d<   d|d<   d	|d
<   t          dd           t          dd           |                                 d|d<   d|d
<   t          dd           t          dd           d d d            d S # 1 swxY w Y   d S )Nzntpath.expanduser("test")testzntpath.expanduser("~test")z~testC:\	HOMEDRIVEz
Users\ericHOMEPATHericUSERNAMEzC:\Users\testzntpath.expanduser("~")zC:\Users\ericz
Users\testUSERPROFILEz"ntpath.expanduser("~test\foo\bar")zC:\Users\test\foo\barz"ntpath.expanduser("~test/foo/bar")zC:\Users\test/foo/barzntpath.expanduser("~\foo\bar")zC:\Users\eric\foo\barzntpath.expanduser("~/foo/bar")zC:\Users\eric/foo/barzF:\HOMEidle)rE   r   r   r   r   s     r   test_expanduserzTestNtpath.test_expanduserp  sW   *F333*,, *	@IIKKK/999%C+C
O$C
O/1BCCC+->???K /???+];;;IIKKK!2C$C
O/1BCCC+->???9.0 0 07,. . .5.0 0 03,. . . IIKKK CK!2C$C
O/1BCCC+->??? IIKKK!2C$C
O/999+->???U*	@ *	@ *	@ *	@ *	@ *	@ *	@ *	@ *	@ *	@ *	@ *	@ *	@ *	@ *	@ *	@ *	@ *	@s   E6F''F+.F+zabspath requires 'nt' modulec                    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           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(           t          d+d(           t          d,d(           t          d-d           t          d.d           t          d/d           t          d0d           t          d1d           t          j        t          j                  5 }t          d2|           t          d3|d4z              t          d5|d6z              t	          j        |          \  }}t          d7|d8z              d d d            d S # 1 swxY w Y   d S )9Nzntpath.abspath("C:\")r   z-ntpath.abspath("\\?\C:////spam////eggs. . .")z\\?\C:\spam\eggsz-ntpath.abspath("\\.\C:////spam////eggs. . .")z\\.\C:\spam\eggsz#ntpath.abspath("//spam//eggs. . .")z\\spam\eggsz#ntpath.abspath("\\spam\\eggs. . .")zntpath.abspath("C:/spam. . .")zC:\spamzntpath.abspath("C:\spam. . .")zntpath.abspath("C:/nul")z\\.\nulzntpath.abspath("C:\nul")zntpath.abspath("//..")r3   zntpath.abspath("//../")z\\..\zntpath.abspath("//../..")zntpath.abspath("//../../")z\\..\..\zntpath.abspath("//../../../")zntpath.abspath("//../../../..")z ntpath.abspath("//../../../../")zntpath.abspath("//server")z\\serverzntpath.abspath("//server/")z	\\server\zntpath.abspath("//server/..")zntpath.abspath("//server/../")z\\server\..\z ntpath.abspath("//server/../..")z!ntpath.abspath("//server/../../")z#ntpath.abspath("//server/../../..")z$ntpath.abspath("//server/../../../")z ntpath.abspath("//server/share")z\\server\sharez!ntpath.abspath("//server/share/")r   z#ntpath.abspath("//server/share/..")z$ntpath.abspath("//server/share/../")z&ntpath.abspath("//server/share/../..")z'ntpath.abspath("//server/share/../../")zntpath.abspath("C:\nul. . .")zntpath.abspath("//... . .")zntpath.abspath("//.. . . .")zntpath.abspath("//../... . .")zntpath.abspath("//../.. . . .")zntpath.abspath("")zntpath.abspath(" ")z\ zntpath.abspath("?")z\?zntpath.abspath("/abc/")z\abc)rE   r   temp_cwdr   r"   rl   )rJ   cwd_dirdrive_s       r   test_abspathzTestNtpath.test_abspath  s=   '000ACZ[[[ACZ[[[4:JKKK8:JKKK/*===0*===)L999*L999'6:::(:>>>*:>>>+>BBB.>BBB0>BBB1>BBB+|DDD,~FFF.~FFF/7IJJJ17IJJJ27IJJJ47IJJJ57IJJJ1:MNNN2:OPPP4:OPPP5:OPPP7:OPPP8:OPPP/>>>,v666-v666/*===0*===	 011 	?W'111('E/:::('E/:::(11HE1,ego>>>	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	?s   A!J==KKc                 2   t          dd           t          dd           t          dd           t          dd           t          j        t          j                  5 }t	          j        |          }t          dd	|z   d
z              t          dd	|z   dz              d d d            n# 1 swxY w Y   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 )$Nzntpath.relpath("a")ry   z#ntpath.relpath(ntpath.abspath("a"))zntpath.relpath("a/b")r   zntpath.relpath("../a/b")z..\a\bzntpath.relpath("a", "../b")r   rz   zntpath.relpath("a/b", "../c")z\a\bzntpath.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")zntpath.relpath("a", "a")r   z(ntpath.relpath("/foo/bar/bat", "/x/y/z")z..\..\..\foo\bar\batz*ntpath.relpath("/foo/bar/bat", "/foo/bar")batz#ntpath.relpath("/foo/bar/bat", "/")zfoo\bar\batz#ntpath.relpath("/", "/foo/bar/bat")r   z$ntpath.relpath("/foo/bar/bat", "/x")z..\foo\bar\batz$ntpath.relpath("/x", "/foo/bar/bat")z
..\..\..\xzntpath.relpath("/", "/")zntpath.relpath("/a", "/a")zntpath.relpath("/a/b", "/a/b")z"ntpath.relpath("c:/foo", "C:/FOO"))rE   r   r   r   r"   r   )rJ   r   
currentdirs      r   test_relpathzTestNtpath.test_relpath  s   $c***4c:::&///):666	 011 	PW11J0&2CE2IJJJ2F:4Eh4NOOO	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	+[999;=TUUUQS^___)3///9;VWWW;UCCC4oFFF4lCCC57JKKK5GGG)3///+S111/5553S99999s   AB,,B03B0c                     d } fd}                      t          t          j        g             |t          ddg            |t          dd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dgd            |ddgd            |ddgd            |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            |g 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                 T    t          d| z                      dd          |           d S )Nzntpath.commonpath(%r)r3   r2   )rE   r8   )pathsr   s     r   r   z)TestNtpath.test_commonpath.<locals>.check  s9    +e3<<VTJJ    r   c                                          | t          j        |                                | t          j        d |D                        d S )Nc                 6    g | ]}t          j        |          S rU   )r$   r:   r&   s     r   
<listcomp>zCTestNtpath.test_commonpath.<locals>.check_error.<locals>.<listcomp>  s     ===!r{1~~===r   )r   r"   
commonpath)excr  rJ   s     r   check_errorz/TestNtpath.test_commonpath.<locals>.check_error  sX    c6#4e<<<c6#4==u===? ? ? ? ?r   zC:\Program FileszProgram FileszC:Program Filesz\Program FileszC:\Program Files\zC:\\Program FileszC:\Program Files\\zC:\.\Program FileszC:\Program Files\.r   zC:\binzC:\Program Files\BarzC:\Program Files\FoozC:\ProjectszC:/Program Files/Barzc:/program files/barzc:\program fileszD:\Program Filesr   alotr[   and\jamand\spamandzand\\jamz
and\spam\\z	and\.\jamz
.\and\spam)r  r  r  )r  r  r  z	C:and\jamz
C:and\spamzC:andz	spam\alotz
\spam\alots   C:\Program FileszProgram Files\Foos   Program Filess   C:\Program Files\Foos   Program Files\Foo)r   
ValueErrorr"   r  	TypeError)rJ   r   r  s   `  r   test_commonpathzTestNtpath.test_commonpath  s   	 	 		? 	? 	? 	? 	?
 	*f&7<<<J!4o FGGGJ!46G HIIIJ!2O DEEEJ2E FGGG"#%8999"$78:MNNN$&9:!	# 	# 	#$&;<!	# 	# 	#$&=>!	# 	# 	#%'=>!	# 	# 	#vy!6***"I.777"$<=!	# 	# 	#')AB!	# 	# 	#"N3V<<<$n5v>>>')?@!	# 	# 	#')?@!	# 	# 	#%'?@!	# 	# 	# 	J!46I JKKKvhvv'''vv###z;'///|_-u555}n-u555///444...666|]+W555rdBr< "%%%J^ 4555)V%6/1IJ	L 	L 	L)V%6/1EF	H 	H 	H)V%6+-EF	H 	H 	H)V%6.0IJ	L 	L 	L)V%6.0EF	H 	H 	H)V%6*,EF	H 	H 	H 	H 	Hr   z&Emscripten cannot fstat unnamed files.c           	      ~   t                      5 }t                      5 }|                     t          j        |                                |                                                     |                     t          j        |                                |                                                     t          j        dk    rG|                     t                    5  t          j        dd           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nwin32)
r   
assertTruer"   sameopenfilefilenoassertFalsesysplatformr   r   )rJ   tf1tf2s      r   test_sameopenfilezTestNtpath.test_sameopenfile*  s   __ 
	0]__ 
	0OOF/

cjjllKKLLLV0szz||LLMMM|w&&&&w// 0 0 'B///0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0 
	0sY   D2CD!D7DDD
DDD2D	D2!D	"D22D69D6c                 B   |                      t          j        d                     |                      t          j        d                     |                      t          j        d                     |                      t          j        d                     |                      t          j        d                     |                      t          j        d                     |                      t          j        d                     |                      t          j        d                     |                      t          j        d	                     |                      t          j        d
                     |                      t          j        d                     |                      t          j        d                     t          j                    5 }|                     t          j        |                     d d d            n# 1 swxY w Y   t          j        dk    rgt          j	        d          }t          j
        |          \  }}t          j        |          5  |                     t          j        |                                                     |                     t          j        |                                                     d d d            n# 1 swxY w Y   |                      t          j        d                     |                      t          j        d                     |                      t          j        d                     |                      t          j        d                     d S d S )Nrp   r   rq   zC:/z\\.\c:\z\\.\C:\s   c:\s   C:\s   c:/s   C:/s   \\.\c:\s   \\.\C:\r  
SystemRootz\\localhost\c$z\\localhost\c$\s   \\localhost\c$s   \\localhost\c$\)r  r"   ismountr   temp_dirr  r  r  r$   getenvrl   r   r   upper)rJ   r   test_cwdr   r   s        r   test_ismountzTestNtpath.test_ismount8  sL   v..///v..///u--...u--...}55666}55666w//000w//000v..///v..///~66777~66777!! 	0QV^A..///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 <7"" y..H +H55KE4%h// @ @  !>!>???  !>!>???@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ OOFN+>??@@@OOFN+@AABBBOOFN+?@@AAAOOFN+ABBCCCCC! #"s%   ((HH #H 7A3K66K:=K:c                 z    |                      |                                |                                           dS )z<Assert that two strings are equal ignoring case differences.N)rI   r   )rJ   s1s2s      r   assertEqualCIzTestNtpath.assertEqualCI\  s.    RXXZZ00000r   zOS helpers require 'nt' modulec                 *   t          j        t          j                  }|t	          j        |          fD ]`}t          j        |          }t          j        |          d         }t          j        |          d         }| 	                    ||           at          j
        t          j                  \  }}|                     |d           |                     |d           t          j
        t          j                                                  \  }}	|                     ||           |                     |	d           t          j        t          j        fD ]}t          j        |          }
|                     |
t"                     |                     t%          |
          d           t          j        |                                          }|                     |t&                     |                     t%          |          d           d S )Nr   )nt_getfinalpathnamer  
executabler$   r:   _getvolumepathnamer"   rl   r-  _getdiskusageexec_prefixassertGreaterr<   rI   prefixassertIsInstancer,   lenr+   )rJ   r1  r   volume_path
path_drivevolume_path_drivecapfreeb_capb_free
final_pathb_final_paths               r   test_nt_helperszTestNtpath.test_nt_helpers`  s   
 )#.99
J 7 77 	> 	>D/55K*4003J & 1+ > >q Az+<====$S_55	T3"""4###()?)?)A)ABBv$$$61%%%Z0 	5 	5D-d33J!!*c222s:222/>>L!!,666s<00!4444	5 	5r   N))rR   rS   rT   r^   rm   rr   ru   rw   r~   r   r   r   r   skip_unless_symlinkunittest
skipUnlessHAVE_GETFINALPATHNAMEr   r   r   r   r   r   r   r   HAVE_GETSHORTPATHNAMEr   r   r   r   r   r/  r  r  r  skipIfr   r!  r)  r-  rB  rU   r   r   rW   rW   X   s       
D 
D 
D4: 4: 4:l
S 
S 
S/ / /" " "?R ?R ?RB(2 (2 (2TD D D
6 
6 
6 "X.0HIIU U JI #"U2 "X.0HII	T 	T JI #"	T "X.0HIID D JI #"D "X.0HII5D 5D JI #"5Dn "X.0HII+O +O JI #"+OZ "X.0HII(' (' JI #"('T "X.0HII8 8 JI #"8@ X.0HII5 5 JI5 X.0HIIX.0HIIN N JI JIN6D D D4 X.0LMME E NME&-@ -@ -@b X;<<)? )? =<)?V: : :0CH CH CHJ X_]$LMM0 0 NM0"D "D "DH1 1 1 X=>>5 5 ?>5 5 5r   rW   c                       e Zd ZeZdgZdS )NtCommonTestr   N)rR   rS   rT   r"   
pathmodule
attributesrU   r   r   rJ  rJ  ~  s        JJJJr   rJ  c                       e Zd ZeZd Zd Zd Zd Zd Z	d Z
d Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )PathLikeTestsc                 6   t           j        | _        t          t           j                  | _        |                     t           j        | j                   t          | j        dd          5 }|                    d           d d d            d S # 1 swxY w Y   d S )Nxbr   s   test_ntpath.PathLikeTests)	r   r   	file_namer   	file_pathr   r   r   r   )rJ   files     r   setUpzPathLikeTests.setUp  s    ")!)"233	($.999$.$** 	5dJJ3444	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5s   +BBBc                 j    |                       || j                   || j                             d S r!   )rM   rR  rQ  )rJ   funcs     r   _check_functionzPathLikeTests._check_function  s6    TT$.11443G3GHHHHHr   c                    |                      | j        j                   t          j        dk    rR|                     t          j        d          d           |                     t          j        d          d           d S d S )Nr  u   ΩΩu   ωΩzabc def)rW  r   r#   r  r  rI   r"   r]   s    r   test_path_normcasez PathLikeTests.test_path_normcase  sv    TY/000<7""V_^<<gFFFV_\::LIIIII #"r   c                 D    |                      | j        j                   d S r!   )rW  r   isabsr]   s    r   test_path_isabszPathLikeTests.test_path_isabs       TY_-----r   c                     |                      | j                            dt          d          d          | j                            ddd                     d S )Nry   br   )rI   r   r   r   r]   s    r   test_path_joinzPathLikeTests.test_path_join  sS    Xc]]C@@S#66	8 	8 	8 	8 	8r   c                 D    |                      | j        j                   d S r!   )rW  r   splitr]   s    r   test_path_splitzPathLikeTests.test_path_split  r]  r   c                 D    |                      | j        j                   d S r!   )rW  r   splitextr]   s    r   test_path_splitextz PathLikeTests.test_path_splitext  !    TY/00000r   c                 D    |                      | j        j                   d S r!   )rW  r   rl   r]   s    r   test_path_splitdrivez"PathLikeTests.test_path_splitdrive  !    TY122222r   c                 D    |                      | j        j                   d S r!   )rW  r   r   r]   s    r   test_path_basenamez PathLikeTests.test_path_basename  rg  r   c                 D    |                      | j        j                   d S r!   )rW  r   r   r]   s    r   test_path_dirnamezPathLikeTests.test_path_dirname  !    TY./////r   c                 D    |                      | j        j                   d S r!   )rW  r   islinkr]   s    r   test_path_islinkzPathLikeTests.test_path_islink  s!    TY-.....r   c                 D    |                      | j        j                   d S r!   )rW  r   lexistsr]   s    r   test_path_lexistszPathLikeTests.test_path_lexists  ro  r   c                 D    |                      | j        j                   d S r!   )rW  r   r$  r]   s    r   test_path_ismountzPathLikeTests.test_path_ismount  ro  r   c                 D    |                      | j        j                   d S r!   )rW  r   
expanduserr]   s    r   test_path_expanduserz"PathLikeTests.test_path_expanduser  rj  r   c                 D    |                      | j        j                   d S r!   )rW  r   
expandvarsr]   s    r   test_path_expandvarsz"PathLikeTests.test_path_expandvars  rj  r   c                 D    |                      | j        j                   d S r!   )rW  r   r   r]   s    r   test_path_normpathz PathLikeTests.test_path_normpath  rg  r   c                 D    |                      | j        j                   d S r!   )rW  r   r   r]   s    r   test_path_abspathzPathLikeTests.test_path_abspath  ro  r   c                 D    |                      | j        j                   d S r!   )rW  r   r   r]   s    r   test_path_realpathz PathLikeTests.test_path_realpath  rg  r   c                 D    |                      | j        j                   d S r!   )rW  r   r   r]   s    r   test_path_relpathzPathLikeTests.test_path_relpath  ro  r   c                     | j                             | j        | j        g          }|                     || j                   d S r!   )r   r  rR  rQ  rM   )rJ   common_paths     r   test_path_commonpathz"PathLikeTests.test_path_commonpath  s>    i**DNDN+KLL[$.99999r   c                 D    |                      | j        j                   d S r!   )rW  r   isdirr]   s    r   test_path_isdirzPathLikeTests.test_path_isdir  r]  r   N)rR   rS   rT   r"   r   rT  rW  rY  r\  r`  rc  rf  ri  rl  rn  rr  ru  rw  rz  r}  r  r  r  r  r  r  rU   r   r   rN  rN    sZ       D5 5 5I I IJ J J. . .8 8 8. . .1 1 13 3 31 1 10 0 0/ / /0 0 00 0 03 3 33 3 31 1 10 0 01 1 10 0 0: : :. . . . .r   rN  __main__)"r"   r$   r   r  rD  r=   test.supportr   r   r   test.support.os_helperr   r   r   tempfiler   r/  ImportErrorr0  rF  AttributeErrorr   rG  r   r0   rE   TestCaserG   rW   
CommonTestrJ  rN  rR   mainrU   r   r   <module>r     sp    				  



   " " " " " " 2 2 2 2 2 2 2 2 + + + + + + ! ! ! ! ! ! " " " " " "IIII    
BBB
!
 !  " " "!"
#MMM !
# 
# 
# 
#	  " " "!"   < < <03 3 3 3 3X& 3 3 3d5 d5 d5 d5 d5 d5 d5 d5L    #.0A   
J. J. J. J. J.N J. J. J.Z zHMOOOOO s3   ? A	A	A A! A!%A/ /A98A9