Current File : //opt/imh-python/lib/python2.7/test/test_posixpath.pyo
�
��Wc@s�ddlZddlmZmZddlmZddlZddlZddlZddlmZm	Z	m
Z
mZe	ej�Z
d�Zd�Zdejfd��YZd	ejfd
��YZd�Zedkr�e�ndS(
i����N(ttest_supportttest_genericpath(R(trealpathtabspathtdirnametbasenamecCs/dtk}d}|tj|�|�g|S(s�
    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.
    s\s'ABSTFN is not a posix path - tests fail(tABSTFNtunittesttskip(ttesttfound_backslashtmsg((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt!skip_if_ABSTFN_contains_backslashscCs)ytj|�Wntk
r$nXdS(N(tostrmdirtOSError(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt
safe_rmdirs
t
PosixPathTestcBseZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zed��Zed��Zeed�r�d�Zd�Zd�Zd�Zd�Zd�Zd�Znd�Zejd��Z RS(cCs|j�dS(N(ttearDown(tself((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pytsetUp!scCsCx<dddgD]+}tjtj|�ttj|�qWdS(Ntt1t2(RtunlinktTESTFNR(Rtsuffix((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyR$scCsd|jtjdddd�d�|jtjddd�d�|jtjddd	�d
�dS(Ns/footbars/bartbazs/bar/bazs/foo/bar/bazs/foo/sbar/sbaz/s
/foo/bar/baz/(tassertEqualt	posixpathtjoin(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt	test_join)s"cCs�|jtjd�d�|jtjd�d�|jtjd�d
�|jtjd�d�|jtjd	�d�dS(Ns/foo/bars/fooRt/Rtfoos////foos////s
//foo//bars//foo(s/foosbar(R!R(RR"(s////R"(s//foosbar(RRtsplit(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt
test_split.s
cCs�|jtj|�||f�|jtjd|�d||f�|jtjd|�d||f�|jtjd|�d||f�|jtjd|�d||f�|jtj|d�||ddf�dS(NR!sabc/sabc.def/s	/abc.def/R(RRtsplitext(Rtpathtfilenametext((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pytsplitextTest5s''''cCs�|jddd�|jddd�|jddd�|jdd	d
�|jddd�|jd
d
d�|jddd�|jddd�|jddd�|jddd�|jddd�|jddd�dS(Nsfoo.barR"s.barsfoo.boo.barsfoo.boosfoo.boo.biff.barsfoo.boo.biffs.csh.rcs.cshs.rctnodotsRs.cshrcs...manydotss...manydots.exts.extt.s..s........(R)(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt
test_splitext=scCs�|jtjd�t�|jtjd�t�|jtjd�t�|jtjd�t�|jtjd�t�dS(NRR!s/foos/foo/barsfoo/bar(tassertIsRtisabstFalsetTrue(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt
test_isabsKs
cCs�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�dS(Ns/foo/barRR!RR"s////foos
//foo//bar(RRR(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt
test_basenameRs
cCs�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d	�dS(
Ns/foo/bars/fooR!R"Rs////foos////s
//foo//bars//foo(RRR(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_dirnameYs
cCsV|jtjtjd�t�ttjdd�}z�|jd�|j�|jtjtjd�t�t	t
d�r4t
jtjdtjd�|jtjtjd�t�t
j
tjd�|jtjtjd�t�|jtjtjd�t�|jtjtjd�t�nWd|j�sQ|j�nXdS(NRtwbR"tsymlinkR(R-RtislinkRRR/topentwritetclosethasattrR
R5R0tremovetexiststlexists(Rtf((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_islink`s 

    'cCsAttjdd�}z
|jd�|j�|jtjtjdtjd�t�t	t
d�rt
jtjdtjd�|jtjtjdtjd�t�t
jtjd�ttjdd�}|jd�|j�|jtjtjdtjd�t
�nWd|j�s<|j�nXdS(NRR4R"R5RR(R7RRR8R9R-RtsamefileR0R:R
R5R;R/(RR>((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt
test_samefilers:










cCswttjdd�}z@|jd�|j�|jtjtj	tjd�tj	tjd��t
�ttd�rUtjtjdtjd�|jtjtj	tjd�tj	tjd��t
�tj
tjd�ttjdd�}|jd�|j�|jtjtj	tjd�tj	tjd��t�nWd|j�sr|j�nXdS(NRR4R"R5RR(R7RRR8R9R-RtsamestatR
tstatR0R:R5R;R/(RR>((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt
test_samestat�s6



cCs|jtjd�t�dS(NR!(R-RtismountR0(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_ismount�scCs�|jtjd�d�tj��m}xcdD][}||d<|jtjd�d�|jtjd�d�|jtjd	�d
�q/WWdQXyddl}Wntk
r�n�X|jtjd�t�tjd�dkr|jtjd�dtjd��n|jtjd�t�|jtjd
�t�tj��T}|d=|j	t
j��j}|j
d�p�d}|jtjd�|�WdQXdS(NR"R!Rs//s///tHOMEt~s~/s~/foos/fooi����s~root/s~foo/(R!Rs//s///(RRt
expanduserRtEnvironmentVarGuardtpwdtImportErrortassertIsInstancet
basestringtgetpwuidR
tgetuidtpw_dirtrstrip(RtenvthomeRK((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_expanduser�s.

#
cCs�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d�|jtjd�d	�|jtjd
�d�dS(NRR+R!s//s///s///foo/.//bar//s/foo/bars///foo/.//bar//.//..//.//bazs/foo/bazs///..//./foo/.//bar(RRtnormpath(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt
test_normpath�scCsh|jtd�tj��|jtd�tj��|jtdjdgd��tj��dS(NR+s./.R!id(RRR
tgetcwdR(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_realpath_curdir�scCst|jtd�ttj���|jtd�tttj����|jtdjdgd��d�dS(Ns..s../..R!id(RRRR
RXR(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_realpath_pardir�s"(R5cCsGz2tjtdt�|jtt�td�Wdtjt�XdS(NR(R
R5RRRRR(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_realpath_basic�scCs�z0tjtt�|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�WdQXWdt	j
t�t	j
td�t	j
td�t	j
td�t	j
td�t	j
td�XdS(NRRs1/xs1/..s1/../xs/xtxtys1/../sa/btas../R!tc(R
R5RRRRRtsupportt
change_cwdRR(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_realpath_symlink_loopss8 $!!0&
cCs�z]tjt�tjdtt�td�tjdtd�|jttd�t�Wdtjtd�tjtd�t	t�XdS(Ns../s/selfsself/self/selfs/link(
R
tmkdirRR5RRRRRR(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt(test_realpath_repeated_indirect_symlinks+s
cCsd}z�tjt�xDt|�D]6}tjdjd|gd�td|d�q#Wtjdtd�|jttd|�t�tj	t��|jtd|�t�WdQXWdx-t|d�D]}t
jtd|�q�Wtt�XdS(Ni
R!s%ds/%diR+s/0(
R
RcRtrangeR5RRRR`RaRRR(Rtdepthti((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_realpath_deep_recursion7s
4$cCs�zntjt�tjtd�tjtdtd�tjtd��|jtd�td�WdQXWdtj	td�t
td�t
t�XdS(Ns/ys/kR^s/y/a(R
RcRR5R`RaRRRRR(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_realpath_resolve_parentsHs
$cCs�z�tjt�tjtd�tjtd�tjtdtd�|jttd�td�tjtt���)|jtt	t�d�td�WdQXWdt
jtd�ttd�ttd�tt�XdS(Ns/ks/k/ys/link-ys
/link-y/..(
R
RcRR5RRR`RaRRRRR(R((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt(test_realpath_resolve_before_normalizingYs
cCs�z�tjt�tjtd�tjttd�tjtt���Itt�}|jt	|d�t�|jt	|d�td�WdQXWdt
jtd�ttd�tt�XdS(Ns/ktlinkslink/k(
R
RcRR5R`RaRRRRRRR(Rtbase((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_realpath_resolve_firstss
(cCsFtjd�}t_ztjjtj��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�|jtjdd�d�Wd|t_XdS(NcSsdS(Ns/home/user/bar((((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt<lambda>�si����RR^sa/bs../a/bs../bs../s/as../cs/a/bsb/cs../../aR+s/foo/bar/bats/x/y/zs../../../foo/bar/bats/foo/bartbatR!sfoo/bar/bats../../..s/xs../foo/bar/bats
../../../x(
R
RXR&R#tassertRaisest
ValueErrorRtrelpathRR(Rtreal_getcwdtcurdir((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_relpath�s,"$$ cCs�tj�}tjd�}|j|d�j|�d }|j|�}|s_|jd�ntj��@}|j�d|||<|j	t
jd|�d|�WdQXdS(Ns.\xe6\u0130\u0141\u03c6\u041a\u05d0\u062a\u0e01tignoreisNeeds non-ASCII word charactersRu$%s baru	baz%s bar(tsystgetfilesystemencodingRtutencodetdecodetskipTestRJtclearRRt
expandvars(Rtencodingtletterst
uwnonasciit
swnonasciiRS((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyttest_expandvars_nonascii_word�s
(!t__name__t
__module__RRR R$R)R,R1R2R3R?RARDRFRURWRRYRZR:R
R[RbRdRhRiRjRmRuRtrequires_unicodeR�(((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyRs6											+	'						'					tPosixCommonTestcBs eZeZddddgZRS(RrR@tsameopenfileRB(R�R�Rt
pathmodulet
attributes(((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyR��scCstjtt�dS(N(Rtrun_unittestRR�(((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt	test_main�st__main__(RR	RRR`RR
RwRRRRRRRRtTestCaseRt
CommonTestR�R�R�(((sl/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_posixpath.pyt<module>s"	
	��