��Qc@s�dZddlZddlZddlZddlZddlZddlmZmZm Z m
Z
mZddlm
Z
ddlmZddlmZdejejfd��YZd �Zed
kr�ee��ndS(sTests for distutils.dir_util.i�N(tmkpathtremove_treetcreate_treet copy_treetensure_relative(tlog(tsupport(trun_unittesttDirUtilTestCasecBsweZd�Zd�Zd�Zd�Zejej j
d�d�d��Zd�Zd�Z
d �Zd
�ZRS(cGs=t|�dkr)|jj||�n|jj|�dS(Ni(tlent_logstappend(tselftmsgtargs((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyt_logscCs�tt|�j�g|_|j�}tjj|d�|_tjj|jd�|_ tjj|d�|_
tj|_
|jt_dS(Ntdeeptheretdeep2(tsuperRtsetUpR
tmkdtemptostpathtjointroot_targetttargetttarget2Rtinfotold_logR(Rttmp_dir((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyRs cCs#|jt_tt|�j�dS(N(RRRRRttearDown(R((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyR!scCs�t|jdd�g}|j|j|�t|jdd�t|jdd�d|jd|jg}|j|j|�g|_t|jdd�d|jg}|j|j|�dS(Ntverboseiiscreating %ss'removing '%s' (and everything under it)(RRtassertEqualR
RR(Rtwanted((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyt!test_mkpath_remove_tree_verbosity%s
twins5This test is only appropriate for POSIX-like systems.cCs�tjd�}tj|�t|jd�|jtjtj|j�j�d|@�t|jd�|jtjtj|j�j�d|@�dS(Nii�im( RtumaskRRR!tstattS_IMODEtst_modeR(RR%((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyttest_mkpath_with_custom_mode6s
'cCs�t|jdddgdd�|j|jg�t|jdd�d|jg}t|jdddgdd�|j|j|�t|jdd�dS(NtonettwotthreeR iscreating %si(RRR!R
R(RR"((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyttest_create_tree_verbosityCscCst|jdd�t|j|jdd�|j|jg�t|jdd�t|jdd�tj j
|jd�}t|d�}z|jd�Wd|j
�Xd||jfg}t|j|jdd�|j|j|�t|jdd�t|jdd�dS(NR isok.txttwssome contentscopying %s -> %si(RRRRR!R
RRRRRtopentwritetclose(Rta_filetfR"((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyttest_copy_tree_verbosityPscCs�t|jdd�tjj|jd�}tjj|jd�}xB||fD]4}t|d�}z|jd�Wd|j�XqPWt|j|j �|j
tj|j �dg�t|j
dd�t|j dd�dS(NR isok.txts
.nfs123abcR.ssome content(RRRRRR/R0R1RRR!tlistdirRR(RR2tnfs_fileR3tfh((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyt#test_copy_tree_skips_nfs_temp_fileshscCsntjdkr>|jtd�d�|jtd�d�n,|jtd�d�|jtd�d�dS(Nt/s /home/fooshome/foos some/pathsc:\home\foos
c:home\fooshome\foo(RtsepR!R(R((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyttest_ensure_relativezs
(t__name__t
__module__RRRR#tunittesttskipIftsystplatformt
startswithR)R-R4R8R;(((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyRs
cCs
tjt�S(N(R>t makeSuiteR(((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyt
test_suite�st__main__(t__doc__R>RR&tshutilR@tdistutils.dir_utilRRRRRt distutilsRtdistutils.testsRttest.test_supportRtTempdirManagertTestCaseRRDR<(((s3/sys/lib/python2.7/distutils/tests/test_dir_util.pyt<module>s(s
|