%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_os.pyo

ó
Nźįac@s\ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	yddl
Z
Wnek
r”dZ
nXddl
mZddlmZddlZddlZejddeeƒejddeeƒdejfd„ƒYZd	ejfd
„ƒYZdejfd„ƒYZdd
l
mZdejfd„ƒYZdejfd„ƒYZdejfd„ƒYZdejfd„ƒYZdejfd„ƒYZ ej!dƒdkZ"ej#e"dƒdejfd„ƒYƒZ$dejfd„ƒYZ%ej&ej'dkd ƒd!ejfd"„ƒYƒZ(d#ejfd$„ƒYZ)ej#ej'dkd%ƒd&ejfd'„ƒYƒZ*ej&ej'dkd ƒd(ejfd)„ƒYƒZ+ej&ej'dkd ƒd*ejfd+„ƒYƒZ,d,ejfd-„ƒYZ-d.„Z.ed/krXe.ƒndS(0i’’’’N(ttest_support(tassert_python_oktignorettempnamttmpnamt	FileTestscBs;eZd„ZeZd„Zd„Zejd„ƒZRS(cCs,tjjtjƒr(tjtjƒndS(N(tostpathtexistsRtTESTFNtunlink(tself((s(/usr/local/lib/python2.7/test/test_os.pytsetUpscCsOtjtjtjtjBƒ}tj|ƒ|jtjtjtj	ƒƒdS(N(
RtopenRR	tO_CREATtO_RDWRtcloset
assertTruetaccesstW_OK(Rtf((s(/usr/local/lib/python2.7/test/test_os.pyttest_access#s
cCsŚtjtjtjtjBƒ}tj|ƒ}zjd}x]||dkr–tj|ƒ|d7}|dkr}|jdƒn|tj|ƒ}}q:WWdtj|ƒXtj	||dƒ|j
ttj|dƒdS(Niii
s%couldn't allocate two consecutive fdsita(
RR
RR	RRtdupRtskipTestt
closerangetassertRaisestOSErrortwrite(Rtfirsttsecondtretries((s(/usr/local/lib/python2.7/test/test_os.pyttest_closerange(s

cCsZttjƒ}tj|ƒ}|jttj|dƒtj|ƒ}|j	||ƒdS(Ni(
tunicodeRR	tsystgetrefcountRt	TypeErrorRtrenametassertEqual(RRtoldtnew((s(/usr/local/lib/python2.7/test/test_os.pyttest_rename=s
(	t__name__t
__module__RttearDownRR Rtcpython_onlyR)(((s(/usr/local/lib/python2.7/test/test_os.pyRs
			tTemporaryFileTestscBseZd„Zd„Zd„Zejeedƒdƒd„ƒZ	ejeedƒdƒd„ƒZ
ejeed	ƒd
ƒd„ƒZRS(cCsg|_tjtjƒdS(N(tfilesRtmkdirRR	(R((s(/usr/local/lib/python2.7/test/test_os.pyRGs	cCs5x|jD]}tj|ƒq
WtjtjƒdS(N(R/RR
trmdirRR	(Rtname((s(/usr/local/lib/python2.7/test/test_os.pyR,KscCs=|jtjj|ƒdƒt|dƒ|jj|ƒdS(Ns&file already exists for temporary filetw(tassertFalseRRRR
R/tappend(RR2((s(/usr/local/lib/python2.7/test/test_os.pytcheck_tempfilePs
Rstest needs os.tempnam()c	Cs·tjƒ„tjddtdƒtjddtƒ|jtjƒƒtjtj	ƒ}|j|ƒtjtj	dƒ}|j
tjj|ƒd dkƒ|j|ƒWdQXdS(NRRstest_os$tpfxi(
twarningstcatch_warningstfilterwarningstRuntimeWarningtDeprecationWarningR6RRRR	RRtbasename(RR2((s(/usr/local/lib/python2.7/test/test_os.pyttest_tempnamXs

#ttmpfilestest needs os.tmpfile()c	Cs@tjƒ.tjddtƒtjdkräd}tjj|ƒrWtj	|ƒnyt
|dƒ}Wn]tk
rÉ}ytjƒ}Wn)t
k
r·}|j|j|jƒnX|jdƒdSX|jƒtj	|ƒntjƒ}|jdƒ|jddƒ|jƒ}|jƒ|j|dkƒWdQXdS(	NRR?twin32s \python_test_os_test_tmpfile.txtR3s&expected os.tmpfile() to raise OSErrortfoobari(R8R9R:R<R"tplatformRRRtremoveR
tIOErrorR?RR&targstfailRRtseektreadR(RR2tfpRRts((s(/usr/local/lib/python2.7/test/test_os.pyttest_tmpfilegs.




Rstest needs os.tmpnam()c	Cs‡tjƒutjddtdƒtjddtƒtjƒ}tjdkrp|j	tj
j|ƒdƒn
|j|ƒWdQXdS(NRRstest_os$R@s&file already exists for temporary file(R@(
R8R9R:R;R<RRR"RBR4RRR6(RR2((s(/usr/local/lib/python2.7/test/test_os.pyttest_tmpnam™s

(R*R+RR,R6tunittestt
skipUnlessthasattrRR>RKRL(((s(/usr/local/lib/python2.7/test/test_os.pyR.Fs			$$2tStatAttributeTestscBs"eZd„Zd„Zejeedƒdƒd„ƒZejeedƒdƒd„ƒZ	d„Z
d	„Zejej
d
kdƒejeejƒdkd
ƒd„ƒƒZejej
d
kdƒejeejƒdkd
ƒd„ƒƒZejej
d
kdƒd„ƒZRS(cCsXtjtjƒtjjtjdƒ|_t|jdƒ}|jdƒ|j	ƒdS(Ntf1twbtABC(
RR0RR	RtjointfnameR
RR(RR((s(/usr/local/lib/python2.7/test/test_os.pyRøs

cCs$tj|jƒtjtjƒdS(N(RR
RUR1RR	(R((s(/usr/local/lib/python2.7/test/test_os.pyR,æststatstest needs os.stat()cCsddl}tj|jƒ}|j||jdƒ|j|jdƒt|ƒ}x“t|ƒD]…}|d dkra|jƒ}|jdƒržd„}n	d„}|j|t	||ƒƒ|t	||ƒƒ|j
||ƒqaqaWy|d|jdƒWntk
rnXyd	|_
|jdƒWnttfk
rJnXyd	|_|jdƒWnttfk
r~nXyd	|_|jdƒWntk
r¬nXy tjdƒ}|jdƒWntk
rąnXytjdƒ}Wntk
rnXdS(Ni’’’’itST_tTIMEcSs
t|ƒS(N(tint(tx((s(/usr/local/lib/python2.7/test/test_os.pyttruncŅtcSs|S(N((RZ((s(/usr/local/lib/python2.7/test/test_os.pyR[ŌR\iČsNo exception raisedii
iiiiiiii	iii
i(i
(iiiiiiiiii	i
iii
i(RVRRUR&tST_SIZEtst_sizetdirtlowertendswithtgetattrtassertInRFt
IndexErrortst_modetAttributeErrorR$tst_rdevtparrottstat_result(RRVtresulttmembersR2tattrR[tresult2((s(/usr/local/lib/python2.7/test/test_os.pyttest_stat_attributesĆsV	
			


tstatvfsstest needs os.statvfs()cCsdytj|jƒ}Wn5tk
rM}|jtjkrN|jdƒqNnX|j|j|dƒd}x;t	|ƒD]-\}}|jt
|d
|ƒ||ƒqxWyd|_|jdƒWntk
rÖnXyd|_
|jdƒWntk
rnXy tjdƒ}|jdƒWntk
r8nXytjdƒ}Wntk
r_nXdS( Ns%glibc always returns ENOSYS on AtheOSitbsizetfrsizetblockstbfreetbavailR/tffreetfavailtflagtnamemaxtf_isNo exception raisedi
iiiiiiii	iii
i(
RpRqRrRsRtR/RuRvRwRx(i
(iiiiiiiiii	i
iii
i(RRoRURterrnotENOSYSRR&tf_bfreet	enumerateRbRFR$RhRftstatvfs_result(RRjteRktvaluetmemberRm((s(/usr/local/lib/python2.7/test/test_os.pyttest_statvfs_attributess:%	
	


cCswd}tjtjƒ}tjtj|jt|j|ƒfƒtjtjƒ}|j|jt|j|ƒƒdS(Ni@B(	RRVRR	tutimetst_atimeRYtst_mtimeR&(Rtdeltatsttst2((s(/usr/local/lib/python2.7/test/test_os.pyttest_utime_dir,s
)c
Cs—tjdkr“tjjtjj|ƒƒdd}ddl}|jj}|j	ddƒ}|j
|ddddd|t|ƒƒr“|j
SndS(NR@is\i’’’’R\id(R"RBRRt
splitdrivetabspathtctypestwindlltkernel32tcreate_string_buffertGetVolumeInformationAtNonetlenR€(RtrootRŒRŽtbuf((s(/usr/local/lib/python2.7/test/test_os.pytget_file_system7s&*R@sWin32 specific teststNTFSs
requires NTFScCsBd}tj|j||fƒ|jtj|jƒj|ƒdS(NgŠgśEŃA(RRƒRUR&RVR…(Rtt1((s(/usr/local/lib/python2.7/test/test_os.pyttest_1565150@scCsBd}tj|j||fƒ|jtj|jƒj|ƒdS(NIņ*(RRƒRUR&RVR…(RR—((s(/usr/local/lib/python2.7/test/test_os.pyttest_large_timeHscCsWytjdƒWn?tk
rR}|jdkrB|jdƒn|jdƒnXdS(Nsc:\pagefile.sysisc:\pagefile.sys does not existsCould not stat pagefile.sys(RRVtWindowsErrorRzRRF(RR((s(/usr/local/lib/python2.7/test/test_os.pyttest_1686475Ps(R*R+RR,RMRNRORRnR‚R‰R•R"RBRR	R˜R™R›(((s(/usr/local/lib/python2.7/test/test_os.pyRP·s		$=$,			(t
mapping_teststEnvironTestscBsheZdZd
Zd„Zd„Zd„Zd„Zd„Z	e
jej
jdƒdƒd	„ƒZRS(s8check that os.environ object conform to mapping protocolcCsidd6dd6dd6S(NtVALUE1tKEY1tVALUE2tKEY2tVALUE3tKEY3((R((s(/usr/local/lib/python2.7/test/test_os.pyt
_reference_scCstjjƒtjS(N(Rtenvirontclear(R((s(/usr/local/lib/python2.7/test/test_os.pyt_empty_mappingas
cCs#ttjƒ|_tjjƒdS(N(tdictRR„t_EnvironTests__saveR¦(R((s(/usr/local/lib/python2.7/test/test_os.pyRdscCs$tjjƒtjj|jƒdS(N(RR„R¦tupdateR©(R((s(/usr/local/lib/python2.7/test/test_os.pyR,gs
cCsftjjdƒrbtjjddƒtjdƒ)}|jƒjƒ}|j|dƒWdQXndS(Ns/bin/shtHELLOtWorlds/bin/sh -c 'echo $HELLO'(	RRRR„RŖtpopenRHtstripR&(RR­R€((s(/usr/local/lib/python2.7/test/test_os.pyttest_update2ls
tfreebsdtdarwins%due to known OS bug: see issue #13415cCsXtjdkr5dd}|jttjj|ƒnd}|jttjj|ƒdS(NR@RZiPĆskey=(R"RBRt
ValueErrorRR„t__delitem__R(Rtkey((s(/usr/local/lib/python2.7/test/test_os.pyttest_unset_errorus

N(R°R±(R*R+t__doc__R‘t	type2testR¤R§RR,RÆRMtskipIfR"RBt
startswithRµ(((s(/usr/local/lib/python2.7/test/test_os.pyR\s						t	WalkTestscBs eZdZd„Zd„ZRS(sTests for os.walk().cCslddl}ddlm}|tjdƒ}||dƒ}||dƒ}||dƒ}||dƒ}||dƒ}||d	ƒ}	||d
ƒ}
|tjdƒ}|tjddƒ}|j|ƒ|j|ƒ|j|ƒxH|||	|fD]4}
t|
d
ƒ}|jd|
dƒ|jƒqųWt	|dƒrs|j
|jj|ƒ|
ƒ|d
gd	gf}n|gd	gf}t
|j|ƒƒ}|jt|ƒdƒ|ddddk}|ddjƒ|j|d|ddgdgfƒ|j|d||dgdgfƒ|j|d||ggfƒ|j|dd||ƒg}xR|j|ƒD]A\}}}|j|||fƒd|krz|jdƒqzqzW|jt|ƒdƒ|j|d|dgdgfƒ|j|d|ƒt
|j|dtƒƒ}|jt|ƒdƒ|ddddk}|ddjƒ|j|d|ddgdgfƒ|j|||ggfƒ|j||d|dgdgfƒ|j|dd||ƒt	|dƒrhxi|j|dtƒD]B\}}}||
kr|j|gƒ|j|dgƒPqqW|jdƒndS(Ni’’’’(RTtTEST1tSUB1tSUB11tSUB2ttmp1ttmp2ttmp3tlinktTEST2ttmp4R3sI'm s" and proud of it.  Blame test_os.
tsymlinkiiiiittopdowntfollowlinkss+Didn't follow symlink with followlinks=True(Rtos.pathRTRR	tmakedirstfileRRRORÅRR‹tlisttwalkR&R’tsortR5RCtFalsetTrueRF(RRRTt	walk_patht	sub1_patht
sub11_patht	sub2_patht	tmp1_patht	tmp2_patht	tmp3_patht	link_pathtt2_patht	tmp4_pathRRt	sub2_treetalltflippedR“tdirsR/((s(/usr/local/lib/python2.7/test/test_os.pyttest_traversal„sl


&'!#&'%cCsĀx«tjtjdtƒD]‘\}}}x*|D]"}tjtjj||ƒƒq/WxR|D]J}tjj||ƒ}tjj|ƒs™tj	|ƒq\tj|ƒq\WqWtj	tjƒdS(NRĘ(
RRĢRR	RĪRCRRTtislinkR1(RR“RŻR/R2tdirname((s(/usr/local/lib/python2.7/test/test_os.pyR,Żs(
 
(R*R+R¶RŽR,(((s(/usr/local/lib/python2.7/test/test_os.pyRŗs	YtMakedirTestscBs#eZd„Zd„Zd„ZRS(cCstjtjƒdS(N(RR0RR	(R((s(/usr/local/lib/python2.7/test/test_os.pyRīsc	Csätj}tjj|dddƒ}tj|ƒtjj|ddddƒ}tj|ƒ|jttjtjƒtjj|dddddtjƒ}tj|ƒtjj|dtjdddddƒ}tj|ƒdS(Ntdir1tdir2tdir3tdir4tdir5tdir6(	RR	RRRTRÉRRtcurdir(RtbaseR((s(/usr/local/lib/python2.7/test/test_os.pyttest_makedirńs	

'
cCsstjjtjddddddƒ}x8tjj|ƒra|tjkratjj|ƒ}q*Wtj|ƒdS(NRāRćRäRåRęRē(RRRTRR	RRąt
removedirs(RR((s(/usr/local/lib/python2.7/test/test_os.pyR,s
%(R*R+RRźR,(((s(/usr/local/lib/python2.7/test/test_os.pyRįķs		tDevNullTestscBseZd„ZRS(cCs_ttjdƒ}|jdƒ|jƒttjdƒ}|j|jƒdƒ|jƒdS(NR3thellotrR\(RŹRtdevnullRRR&RH(RR((s(/usr/local/lib/python2.7/test/test_os.pyttest_devnulls

(R*R+Rš(((s(/usr/local/lib/python2.7/test/test_os.pyRģstURandomTestscBs,eZd„Zd„Zd„Zd„ZRS(cCsŸ|jttjdƒƒdƒ|jttjdƒƒdƒ|jttjdƒƒdƒ|jttjdƒƒdƒ|jttjdƒƒdƒdS(Niii
idič(R&R’Rturandom(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_urandom_lengths
cCs2tjdƒ}tjdƒ}|j||ƒdS(Ni(RRņtassertNotEqual(Rtdata1tdata2((s(/usr/local/lib/python2.7/test/test_os.pyttest_urandom_value scCs¾djdd|dddfƒ}tjd|g}tj|dtjd	tjd
tjƒ}|jƒ\}}|j|jƒd|jƒ|fƒt	|ƒ}|jt
|ƒ||ƒ|S(Ns
simport os, syssdata = os.urandom(%s)ssys.stdout.write(repr(data))ssys.stdout.flush()s&print >> sys.stderr, (len(data), data)s-ctstdintstdouttstderri(RTR"t
executablet
subprocesstPopentPIPEtcommunicateR&twaittevalR’(Rtcounttcodetcmd_linetptoutterr((s(/usr/local/lib/python2.7/test/test_os.pytget_urandom_subprocess%s%cCs2|jdƒ}|jdƒ}|j||ƒdS(Ni(RRō(RRõRö((s(/usr/local/lib/python2.7/test/test_os.pyttest_urandom_subprocess7s(R*R+RóR÷RR	(((s(/usr/local/lib/python2.7/test/test_os.pyRńs			tHAVE_GETENTROPYis+getentropy() does not use a file descriptortURandomFDTestscBs#eZejedƒd„ƒZRS(s!test requires the resource modulecCsd}td|ƒdS(NsĢif 1:
            import errno
            import os
            import resource

            soft_limit, hard_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
            resource.setrlimit(resource.RLIMIT_NOFILE, (1, hard_limit))
            try:
                os.urandom(16)
            except OSError as e:
                assert e.errno == errno.EMFILE, e.errno
            else:
                raise AssertionError("OSError not raised")
            s-c(R(RR((s(/usr/local/lib/python2.7/test/test_os.pyttest_urandom_failureBs(R*R+RMRNtresourceR(((s(/usr/local/lib/python2.7/test/test_os.pyR?st	ExecTestscBseZd„Zd„ZRS(cCs |jttjdgdƒdS(Ntnotepad(RR²RtexecvpeR‘(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_execvpe_with_bad_arglist\sc
Csčtjddg}tjjƒ}d|d<|jtƒtj|d||ƒWdQXtjjƒ}d|d<|jtƒtj|d||ƒWdQXtjjƒ}d|d	<|jtƒtj|d||ƒWdQXdS(
Ns-ctpasstcabbagesFRUITVEGETABLEisorangeVEGETABLE=cabbagetFRUITtlemonsFRUIT=ORANGE(	R"RūRR„tcopyRR$texecveR²(RREtnewenv((s(/usr/local/lib/python2.7/test/test_os.pyttest_execve_invalid_env_s


(R*R+RR(((s(/usr/local/lib/python2.7/test/test_os.pyRZs	R@sWin32 specific teststWin32ErrorTestscBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs'|jttjtjtjdƒdS(Ns.bak(RRšRR%RR	(R((s(/usr/local/lib/python2.7/test/test_os.pyR)wscCs|jttjtjƒdS(N(RRšRRCRR	(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_removezscCs|jttjtjƒdS(N(RRšRtchdirRR	(R((s(/usr/local/lib/python2.7/test/test_os.pyt
test_chdir}scCsQttjdƒ}z|jttjtjƒWd|jƒtjtjƒXdS(NR3(	R
RR	RRšRR0RR
(RR((s(/usr/local/lib/python2.7/test/test_os.pyt
test_mkdir€s

cCs |jttjtjdƒdS(N(RRšRRƒRR	R‘(R((s(/usr/local/lib/python2.7/test/test_os.pyt
test_utimeˆscCs |jttjtjdƒdS(Ni(RRšRtchmodRR	(R((s(/usr/local/lib/python2.7/test/test_os.pyt
test_chmod‹s(R*R+R)RRRRR!(((s(/usr/local/lib/python2.7/test/test_os.pyRus					t
TestInvalidFDc	BsļeZdddddddddg	Zd	„Zx%eD]Zeeƒeƒd
e<q7Wd„Zeje	e
dƒd
ƒd„ƒZeje	e
dƒdƒd„ƒZeje	e
dƒdƒd„ƒZ
eje	e
dƒdƒd„ƒZeje	e
dƒdƒd„ƒZeje	e
dƒdƒd„ƒZeje	e
dƒdƒd „ƒZeje	e
d!ƒd"ƒd#„ƒZeje	e
d$ƒd%ƒd&„ƒZeje	e
d'ƒd(ƒd)„ƒZeje	e
d*ƒd+ƒd,„ƒZRS(-tfchdirtfdopenRt	fdatasynctfstattfstatvfstfsynct	tcgetpgrptttynamecs‡fd†}|S(Ncs,ttˆƒr(|jttˆƒƒndS(N(RORtcheckRb(R(R(s(/usr/local/lib/python2.7/test/test_os.pythelper”s((RR,((Rs(/usr/local/lib/python2.7/test/test_os.pyt
get_single“sttest_cGsXy|tjƒ|ŒWn)tk
rB}|j|jtjƒnX|jd|ƒdS(Ns5%r didn't raise an OSError with a bad file descriptor(Rtmake_bad_fdRR&RztEBADFRF(RRRER((s(/usr/local/lib/python2.7/test/test_os.pyR+›s	tisattystest needs os.isatty()cCs#|jtjtjƒƒtƒdS(N(R&RR1RR/RĪ(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_isatty¤sRstest needs os.closerange()cCs“tjƒ}x>tdƒD]0}ytj||ƒWntk
rGqXPqW|dkrktjdƒ‚n|jtj	|||dƒdƒdS(Ni
is5Unable to acquire a range of invalid file descriptorsi(RR/trangeRR&RRMtSkipTestR&RR‘(Rtfdti((s(/usr/local/lib/python2.7/test/test_os.pyR Øs
tdup2stest needs os.dup2()cCs|jtjdƒdS(Ni(R+RR7(R((s(/usr/local/lib/python2.7/test/test_os.pyt	test_dup2østfchmodstest needs os.fchmod()cCs|jtjdƒdS(Ni(R+RR9(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_fchmod¼stfchownstest needs os.fchown()cCs|jtjddƒdS(Ni’’’’(R+RR;(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_fchownĄst	fpathconfstest needs os.fpathconf()cCs|jtjdƒdS(NtPC_NAME_MAX(R+RR=(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_fpathconfÄst	ftruncatestest needs os.ftruncate()cCs|jtjdƒdS(Ni(R+RR@(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_ftruncateČstlseekstest needs os.lseek()cCs|jtjddƒdS(Ni(R+RRB(R((s(/usr/local/lib/python2.7/test/test_os.pyt
test_lseekĢsRHstest needs os.read()cCs|jtjdƒdS(Ni(R+RRH(R((s(/usr/local/lib/python2.7/test/test_os.pyt	test_readŠst	tcsetpgrpstest needs os.tcsetpgrp()cCs|jtjdƒdS(Ni(R+RRE(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_tcsetpgrptŌsRstest needs os.write()cCs|jtjdƒdS(Nt (R+RR(R((s(/usr/local/lib/python2.7/test/test_os.pyt
test_writeŲs(R*R+tsinglesR-RtlocalsR+RMRNRORR2R R8R:R<R?RARCRDRFRH(((s(/usr/local/lib/python2.7/test/test_os.pyR"Žs"	
		$$$$$$$$$$sPosix specific teststPosixUidGidTestscBs(eZejeedƒdƒd„ƒZejeedƒdƒd„ƒZejeedƒdƒd„ƒZejeed	ƒd
ƒd„ƒZ	ejeedƒd
ƒd„ƒZ
ejeedƒd
ƒd„ƒZejeedƒdƒd„ƒZejeedƒdƒd„ƒZ
RS(tsetuidstest needs os.setuid()cCs^tjƒdkr.|jtjtjdƒn|jttjdƒ|jttjdƒdS(Nis
not an intii I(RtgetuidRterrorRLR$t
OverflowError(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_setuidŽstsetgidstest needs os.setgid()cCs^tjƒdkr.|jtjtjdƒn|jttjdƒ|jttjdƒdS(Nis
not an intii I(RRMRRNRQR$RO(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_setgidåstseteuidstest needs os.seteuid()cCs^tjƒdkr.|jtjtjdƒn|jttjdƒ|jttjdƒdS(Nis
not an intii I(RRMRRNRSR$RO(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_seteuidģstsetegidstest needs os.setegid()cCs^tjƒdkr.|jtjtjdƒn|jttjdƒ|jttjdƒdS(Nis
not an intii I(RRMRRNRUR$RO(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_setegidóstsetreuidstest needs os.setreuid()cCs™tjƒdkr1|jtjtjddƒn|jttjddƒ|jttjddƒ|jttjddƒ|jttjddƒdS(Nis
not an intii II(RRMRRNRWR$RO(R((s(/usr/local/lib/python2.7/test/test_os.pyt
test_setreuidśscCstjtjddgƒdS(Ns-cs,import os,sys;os.setreuid(-1,-1);sys.exit(0)(Rüt
check_callR"Rū(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_setreuid_neg1s	tsetregidstest needs os.setregid()cCs™tjƒdkr1|jtjtjddƒn|jttjddƒ|jttjddƒ|jttjddƒ|jttjddƒdS(Nis
not an intii II(RRMRRNR[R$RO(R((s(/usr/local/lib/python2.7/test/test_os.pyt
test_setregidscCstjtjddgƒdS(Ns-cs,import os,sys;os.setregid(-1,-1);sys.exit(0)(RüRYR"Rū(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_setregid_neg1s	(R*R+RMRNRORRPRRRTRVRXRZR\R](((s(/usr/local/lib/python2.7/test/test_os.pyRKÜs$$$$$	$$	tWin32KillTestscBsMeZd„Zd„Zd„Zd„Zejdƒd„ƒZd„Z	RS(cCsddl}ddlm}ddl}|jjj}|j|_|j|j	|j
ƒ|j|j	|jƒ|j	|jƒ|j	|jƒf|_d}t
jtjddj|ƒgdt
jdt
jdt
jƒ}|j|jjƒ|j|jjƒ|j|jjƒd\}}	xÄ||	kr×|jƒdkr×|jt|ƒƒ}
||j|jjƒƒ|
|j|
ƒdddƒ}|j|d	dƒ|
j r½|j!||
j ƒPnt"j#dƒ|d
7}q!W|j$dƒt%j&|j'|ƒ|j!|j(ƒ|ƒdS(Ni’’’’(twintypestrunnings-cs<import sys;sys.stdout.write('{}');sys.stdout.flush();input()RłRśRųiidsPeekNamedPipe failedgš™™™™™¹?is1Did not receive communication from the subprocess(iid()RŒR_tmsvcrtRRŽt
PeekNamedPipetBOOLtrestypetHANDLEtPOINTERtc_chartDWORDtargtypesRüRżR"RūtformatRžt
addCleanupRłRRśRųtpollR‘RR’t
get_osfhandletfilenotsizeofRōR€R&ttimetsleepRFRtkilltpidR(RtsigRŒR_RaRbtmsgtprocRtmaxR”trslt((s(/usr/local/lib/python2.7/test/test_os.pyt_killsF		!	

cCs|jtjƒdS(N(RytsignaltSIGTERM(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_kill_sigtermUscCs|jdƒdS(Nid(Ry(R((s(/usr/local/lib/python2.7/test/test_os.pyt
test_kill_intYscCs6dtjƒ}tjdd|ƒ}d|d<tjtjtjj	tjj
tƒdƒ|gdtjƒ}d
\}}xZ||krÉ|j
ƒdkrÉ|dd	krÆPntjd
ƒ|d7}q}W|jdƒtj|j|ƒtjd
ƒ|j
ƒs2tj|jtjƒ|jdj|ƒƒndS(Ns
test_os_%si’’’’it0iswin_console_handler.pyt
creationflagsit1gą?s'Subprocess didn't finish initializationssubprocess did not stop on {}(ii(tuuidtuuid1tmmapRüRżR"RūRRRTRąt__file__tCREATE_NEW_PROCESS_GROUPRlR‘RpRqRFRrRsRztSIGINTRj(RteventR2ttagnametmRvRRw((s(/usr/local/lib/python2.7/test/test_os.pyt_kill_with_event]s&
!


s.subprocesses aren't inheriting Ctrl+C propertycCsŽddlm}ddl}|j|jƒƒ}|jjj}|j|jƒ|jf|_|j|_	||dƒ|j
tjdƒdS(Ni’’’’(R_itCTRL_C_EVENT(
RŒR_Rftc_intRRŽtSetConsoleCtrlHandlerRcRiRdRŠRzR‹(RR_RŒtNULLR((s(/usr/local/lib/python2.7/test/test_os.pyttest_CTRL_C_EVENTxs
cCs|jtjdƒdS(NtCTRL_BREAK_EVENT(RŠRzR(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_CTRL_BREAK_EVENT‹s(
R*R+RyR|R}RŠRMtskipRR‘(((s(/usr/local/lib/python2.7/test/test_os.pyR^s	6			tWin32ListdirTestscBs2eZdZd„Zd„Zd„Zd„ZRS(sTest listdir on Windows.cCsĮg|_x¤tdƒD]–}d|}tjjtj|ƒ}d|}tjjtj|ƒ}tj|ƒt|dƒ}|j	d|ƒWdQX|jj
||gƒqW|jjƒdS(NisSUB%dsFILE%dR3s'I'm %s and proud of it. Blame test_os.
(t
created_pathsR3RRRTtsupportR	RÉR
RtextendRĶ(RR6tdir_nametdir_patht	file_namet	file_pathR((s(/usr/local/lib/python2.7/test/test_os.pyR“s	


cCstjtjƒdS(N(tshutiltrmtreeR•R	(R((s(/usr/local/lib/python2.7/test/test_os.pyR, scCsˆtjƒ}|jttjtjj|ƒƒƒg|j	D]}|j|ƒ^q:ƒ|jttjtj
tjƒƒƒ|j	ƒdS(s-Test when the path is not an "extended" path.N(R"tgetfilesystemencodingR&tsortedRtlistdirR•R	tdecodeR”tfsencode(Rtfs_encodingR((s(/usr/local/lib/python2.7/test/test_os.pyttest_listdir_no_extended_path£s&cCs«tjƒ}dtjjtjj|ƒƒ}|jt	tj
|ƒƒg|jD]}|j|ƒ^qPƒdtjjtjƒ}|jt	tj
|ƒƒ|jƒdS(s&Test when the path starts with '\\?\'.u\\?\s\\?\N(R"RRRR‹R•R	R R&RžRŸR”(RR¢R((s(/usr/local/lib/python2.7/test/test_os.pyttest_listdir_extended_path°s"&(R*R+R¶RR,R£R¤(((s(/usr/local/lib/python2.7/test/test_os.pyR“s
	
		
t
SpawnTestscBsYeZd„Zejeedƒdƒd„ƒZejeedƒdƒd„ƒZRS(cCsĀtjddg}tjjƒ}d|d<y |tj|d||ƒ}Wntk
r^nX|j|dƒtjjƒ}d|d<y |tj|d||ƒ}Wntk
r»nX|j|dƒtjjƒ}d	|d
<y |tj|d||ƒ}Wntk
rnX|j|dƒt	j
}|jt	j|ƒt
|dƒ}|jdƒWdQXtj|g}tjjƒ}d
|d<|tj|d||ƒ}|j|dƒdS(Ns-cRRsFRUITVEGETABLEiisorangeVEGETABLE=cabbageRRsFRUIT=ORANGER3sPimport sys, os
if os.getenv("FRUIT") != "orange=lemon":
    raise AssertionErrorsorange=lemon(R"RūRR„RtP_WAITR$R&R²RR	RkR
R
R(RtspawnRERtexitcodetfilenameRI((s(/usr/local/lib/python2.7/test/test_os.pyt_test_invalid_envĀs>
 

 

 
	
tspawnvestest needs os.spawnve()cCs|jtjƒdS(N(RŖRR«(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_spawnve_invalid_envšstspawnvpestest needs os.spawnvpe()cCs|jtjƒdS(N(RŖRR­(R((s(/usr/local/lib/python2.7/test/test_os.pyttest_spawnvpe_invalid_envōs(	R*R+RŖRMRNRORR¬R®(((s(/usr/local/lib/python2.7/test/test_os.pyR„Įs	.$cCs;tjtttttttt	t
ttt
tttƒdS(N(Rtrun_unittestRR.RPRRŗRįRģRńRRRR"RKR^R„(((s(/usr/local/lib/python2.7/test/test_os.pyt	test_mainłs t__main__(/RRzRMR8R"RzRüt	sysconfigttextwrapRpR
tImportErrorR‘ttestRttest.script_helperRRƒRR:R;R*tTestCaseRR.RPRœtBasicTestMappingProtocolRRŗRįRģRńtget_config_varR
RøRRRNRBRR"RKR^R“R„R°(((s(/usr/local/lib/python2.7/test/test_os.pyt<module>s\

)q£%l!	&		N@q18	

Zerion Mini Shell 1.0