Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/distutils/tests/test_filelist.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@s�dZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZmZddlmZd	Zd
�Zdejejfd��YZd
�Zedkr�e��ndS(sTests for distutils.filelist.i�N(tdebug(tWARN(tDistutilsTemplateError(t
glob_to_rettranslate_patterntFileList(tcaptured_stdouttrun_unittest(tsupports�include ok
include xo
exclude xo
include foo.tmp
include buildout.cfg
global-include *.x
global-include *.txt
global-exclude *.tmp
recursive-include f *.oo
recursive-exclude global *.x
graft dir
prune dir3
cCs|jdtj�S(s"Converts '/' in a string to os.sept/(treplacetostsep(ts((s3/sys/lib/python2.7/distutils/tests/test_filelist.pytmake_local_pathstFileListTestCasecBskeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZRS(cCs'|j|jt�g�|j�dS(N(tassertEqualtget_logsRt
clear_logs(tself((s3/sys/lib/python2.7/distutils/tests/test_filelist.pytassertNoWarnings%scCs-|jt|jt��d�|j�dS(Ni(t
assertGreatertlenRRR(R((s3/sys/lib/python2.7/distutils/tests/test_filelist.pytassertWarnings)scCs�tj}tjdkr-tjtj�}nxPdddddddfD]3\}}|i|d6}|jt|�|�qIWdS(Ns\sfoo*sfoo[^%(sep)s]*\Z(?ms)sfoo?sfoo[^%(sep)s]\Z(?ms)sfoo??sfoo[^%(sep)s][^%(sep)s]\Z(?ms)sfoo\\*sfoo\\\\[^%(sep)s]*\Z(?ms)sfoo\\\*sfoo\\\\\\[^%(sep)s]*\Z(?ms)sfoo????s2foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s]\Z(?ms)sfoo\\??s"foo\\\\[^%(sep)s][^%(sep)s]\Z(?ms)R(sfoo*sfoo[^%(sep)s]*\Z(?ms)(sfoo?sfoo[^%(sep)s]\Z(?ms)(sfoo??sfoo[^%(sep)s][^%(sep)s]\Z(?ms)(sfoo\\*sfoo\\\\[^%(sep)s]*\Z(?ms)(sfoo\\\*sfoo\\\\\\[^%(sep)s]*\Z(?ms)(sfoo????s2foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s]\Z(?ms)(sfoo\\??s"foo\\\\[^%(sep)s][^%(sep)s]\Z(?ms)(RRtretescapeRR(RRtglobtregex((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyttest_glob_to_re-s	cCst�}t}ddddd|d�|d�|d�|d	�|d
�|d�|d�|d
�|d�|d�g|_x<tjd�D]+}|j�dkr�q�n|j|�q�Wddd|d�|d�|d�|d�|d�|d
�g	}|j|j|�dS(Nsfoo.tmptoktxosfour.txtsbuildout.cfgs.hg/last-message.txtsglobal/one.txtsglobal/two.txtsglobal/files.xsglobal/here.tmpsf/o/f.oos
dir/graft-onesdir/dir2/graft2sdir3/oksdir3/sub/ok.txts
t(	RRtallfilestMANIFEST_INtsplittstriptprocess_template_lineRtfiles(Rt	file_listtltlinetwanted((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyttest_process_template_line?s8															cCs�t�}t��}|jd�WdQX|j|j�d�tt_z9t��}|jd�WdQX|j|j�d�Wdtt_XdS(NtxxxRsxxx
(	RRtdebug_printRtgetvaluetTrueRtDEBUGtFalse(RR&tstdout((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyttest_debug_printgs		cCs<t�}dddg}|j|�|j|j|�dS(Ntatbtc(Rtset_allfilesRR (RR&R%((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyttest_set_allfilesus	
cCs[t�}ddddddg|_|j�|j�|j|jddddg�dS(NR3R4tgR5(RR%tsorttremove_duplicatesR(RR&((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyttest_remove_duplicates{s
	

cCs�|jttddtdt�d��tjd�}|jt|dtdt�|�|jttddtdt�d��|jtddtdt�jd��dS(NR3tanchortis_regextsearchs*.pysfilelist.py(	t
assertTruethasattrRR.R0RtcompileRR>(RR((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyttest_translate_pattern�s	
	
	cCs�t�}|j|jd��t�}ddg|_|j|jd��t�}ddg|_|jd�|j|jdg�dS(Ns*.pysa.pysb.pysa.txt(RtassertFalsetexclude_patternR%R?R(RR&((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyttest_exclude_pattern�s			
cCs�t�}|jg�|j|jd��t�}|jddg�|j|jd��t�}|j|j�|jddg�|jd�|j|jddg�dS(Ns*.pysa.pysb.txtt*(RR6RCtinclude_patternR?tassertIsNoneR R(RR&((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyttest_include_pattern�s	
		
c	Cs�t}t�}x$d!D]}|jt|j|�qWt�}|jd
d|d�g�|jd
�|j|jd
g�|j�|jd�|j|jd
g�|j	�t�}d
d|d�g|_|jd�|j|jd|d�g�|j�|jd�|j|jd|d�g�|j	�t�}|jd
d|d�g�|jd�|j|jd
|d�g�|j�|jd�|j|jd
|d�g�|j	�t�}d
d|d�g|_|jd�|j|jdg�|j�|jd�|j|jdg�|j	�t�}|jd
|d�|d�|d�g�|jd�|j|j|d�|d�g�|j�|jd�|j|j|d�|d�g�|j	�t�}d
|d�|d�|d�g|_|jd�|j|jd
|d�g�|j�|jd�|j|jd
|d�g�|j	�t�}|jd
|d�|d�|d�g�|jd�|j|j|d�|d�g�|j�|jd�|j|j|d�|d�g�|j	�t�}d
|d�|d�|d�g|_|jd�|j|jd
|d�g�|j�|jd �|j|jd
|d�g�|j	�dS("Ntincludetexcludesglobal-includesglobal-excludesrecursive-includesrecursive-excludetgrafttprunetblargsa.pysb.txtsd/c.pysinclude *.pysinclude *.rbsexclude *.pysexclude *.rbsglobal-include *.pysglobal-include *.rbsglobal-exclude *.pysglobal-exclude *.rbsd/b.pysd/c.txtsd/d/e.pysrecursive-include d *.pysrecursive-include e *.pysrecursive-exclude d *.pysrecursive-exclude e *.pysf/f.pysgraft dsgraft esprune dsprune e(	sincludeRKsglobal-includesglobal-excludesrecursive-includesrecursive-excludeRLRMRN(
RRtassertRaisesRR$R6RR%RR(RR'R&taction((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyttest_process_template�s�	
		



	



	



	



	
%

%
	'



	
%

%
	'


(
t__name__t
__module__RRRR*R2R7R;RBRERIRQ(((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyR"s				(						cCs
tjt�S(N(tunittestt	makeSuiteR(((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyt
test_suite'st__main__(t__doc__RRRTt	distutilsRt
distutils.logRtdistutils.errorsRtdistutils.filelistRRRttest.test_supportRRtdistutils.testsRR!RtLoggingSilencertTestCaseRRVRR(((s3/sys/lib/python2.7/distutils/tests/test_filelist.pyt<module>s"		�

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].