%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_fileio.pyc


Nac@s3ddlmZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZddlm
Z
mZmZmZddlmZmZmZdd	lmZdd
lmZdejfdYZd
ejfdYZdZedkr/endS(i(tunicode_literalsN(tarray(tproxy(twraps(tUserList(tTESTFNtcheck_warningstrun_unittesttmake_bad_fd(t
py3k_bytestcpython_onlytcheck_py3k_warnings(t
run_python(tFileIOt
AutoFileTestscBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZejejdkddZdZdZedZedZedZedZedZedZedZedZedZ edZ!dZ"edZ#ed Z$ed!Z%RS("cCsttd|_dS(Nuw(t_FileIORtf(tself((s,/usr/local/lib/python2.7/test/test_fileio.pytsetUpscCs*|jr|jjntjtdS(N(RtclosetostremoveR(R((s,/usr/local/lib/python2.7/test/test_fileio.pyttearDowns	cCswt|j}|jttd|j|jj|j|jjd|_|j	t
t|ddS(Ni
utell(RRtwritetbytestrangetassertEqualttellRtNonetassertRaisestReferenceErrortgetattr(Rtp((s,/usr/local/lib/python2.7/test/test_fileio.pyttestWeakRefss
	cCs|jjttd|j|jjd|jjd|j|jjd|jjd|j|jjd|jjdd|j|jjd|jjdd|j|jjd|jjdd|j|jjddS(	Niii
iiiii(RRRRRRtseek(R((s,/usr/local/lib/python2.7/test/test_fileio.pyttestSeekTell(scCsc|j}|j|jd|j|jtx-dD]%}|jttft||dq6WdS(Nuwbumodeucloseduoops(umodeuclosed(	RRtmodetclosedtFalseRtAttributeErrort	TypeErrortsetattr(RRtattr((s,/usr/local/lib/python2.7/test/test_fileio.pyttestAttributes6s	
cCsw|jjd|jjtdd}ttd|_|jj|}|jtdddg|| dS(	Nstbtxi
uriit
xxxxxxxxxx(RRRRRRtreadintoR(Rtatn((s,/usr/local/lib/python2.7/test/test_fileio.pyttestReadintoBs
cCs^ddg}|jj||jjttd|_|jj}|j|ddS(Nt123t456urbt123456(Rt
writelinesRRRtreadR(Rtltbuf((s,/usr/local/lib/python2.7/test/test_fileio.pyttestWritelinesListKs
cCsdtddg}|jj||jjttd|_|jj}|j|ddS(NR3R4urbR5(RRR6RRRR7R(RR8R9((s,/usr/local/lib/python2.7/test/test_fileio.pyttestWritelinesUserListSs
cCs?|jt|jjdddg|jt|jjddS(Niii(RR(RR6R(R((s,/usr/local/lib/python2.7/test/test_fileio.pyttestWritelinesError[s"cCs|jjd|jjttd|_|j|jjdd|jjd|j|jj	dd|j|jj
dddgdS(Ns
hi
bye
abcurishi
sbye
tabc(RRRRRRR7RR"treadlinet	readlines(R((s,/usr/local/lib/python2.7/test/test_fileio.pyttest_none_args_s
cCs$t|jjdWdQXdS(Nu(RRR(R((s,/usr/local/lib/python2.7/test/test_fileio.pyttestWriteUnicodehs
cCs|jt|jd|jj|jjf|j`|jt|jd|jj|jjf|jj|jt|jddS(Nu<_io.FileIO name=%r mode='%s'>u<_io.FileIO fd=%r mode='%s'>u<_io.FileIO [closed]>(RtreprRtnameR$tfilenoR(R((s,/usr/local/lib/python2.7/test/test_fileio.pyttestReprls	
cCs|j}|j|j|j|j|jt|jd|j|j|jt	t
d}|jt|jd|j|j|j|j|jdS(Ni
uru(
RtassertFalsetisattyR%Rt
ValueErrorR7Rt
assertTrueRRR(R/(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyt
testErrorsus	

cCseddddddddd	d
ddg}tjjd
rL|jdn|jj|j|jjx0|D](}t|j|}|j	t
|qsW|j	t
|jj|j	t
|jjtd|j	t
|jj
|j	t
|jj
d|j	t
|jj|j	t
|jjd|j	t|jj|j	t
|jjddS(Nufilenouisattyuseekableureadableuwritableureadureadallureadlineu	readlinesutellutruncateuflushuatheosiit(tsystplatformt
startswithRRRRIR%RRRHR/t	bytearrayR"RR(R6(Rtmethodst
methodnametmethod((s,/usr/local/lib/python2.7/test/test_fileio.pyttestMethodss$

cCs^ytddWn9tk
rL}|j|jd|j|jdnX|jddS(Nu.uriuShould have raised IOError(RtIOErrortassertNotEqualterrnoRtfilenametfail(Rte((s,/usr/local/lib/python2.7/test/test_fileio.pyttestOpendirsuntu&test only works on a POSIX-like systemcCsdtjdtj}|jt}t|dWdQXtj||j|jj	t	j
dS(Nu.ur(RtopentO_RDONLYRRTRRRt	exceptionRVtEISDIR(Rtfdtcm((s,/usr/local/lib/python2.7/test/test_fileio.pyt
testOpenDirFDs

cstfd}|S(NcsZ|j}tj|jz||Wdy|jjWntk
rTnXXdS(N(RRRRDRT(RR(tfunc(s,/usr/local/lib/python2.7/test/test_fileio.pytwrappers	
(R(RbRc((Rbs,/usr/local/lib/python2.7/test/test_fileio.pytClosedFDscstfd}|S(Ncs|j}tj|jzNy||Wn)tk
r[}|j|jtjnX|jdWdy|jjWntk
rnXXdS(NuShould have raised IOError(	RRRRDRTRRVtEBADFRX(RRRY(Rb(s,/usr/local/lib/python2.7/test/test_fileio.pyRcs	
(R(RbRc((Rbs,/usr/local/lib/python2.7/test/test_fileio.pytClosedFDRaisesscCs|jdS(N(R(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosescCs|jddS(NR0(R(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedWritescCs|jddS(Ni(R"(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedSeekscCs|jdS(N(R(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedTellscCs|jddS(Ni(ttruncate(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedTruncatescCs|jdS(N(tseekable(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedSeekablescCs|jdS(N(treadable(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedReadablescCs|jdS(N(twritable(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedWritablescCs|jdS(N(RD(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedFilenoscCs|j|jtdS(N(RRGR&(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedIsattyscCsTy|jjWntk
r$nXttd|_tj|jj|jS(Nur(RRRTRRRRD(R((s,/usr/local/lib/python2.7/test/test_fileio.pyt
ReopenForReads
cCs|j}|jddS(Ni(RuR7(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedReadscCs|j}|jdS(N(Rutreadall(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedReadall	scCs,|j}tdd}|j|dS(NR,R-i
R.(RuRR/(RRR0((s,/usr/local/lib/python2.7/test/test_fileio.pyttestErrnoOnClosedReadintos(&t__name__t
__module__RRR!R#R+R2R:R;R<R@RARERJRSRZtunittesttskipIfRRCRaRdRfRgRhRiRjRlRnRpRrRsRtRuRvRxRy(((s,/usr/local/lib/python2.7/test/test_fileio.pyRs@																			$
				tOtherFileTestscBseZdZejejdkddZdZdZ	dZ
dZdZd	Z
ed
ZdZdZd
ZdZdZdZdZdZRS(cCs@z+ttd}|j|jt|j|jt|j|jt|jttd}|j|jt|j|jt|j|jt|jttd}|j|jt|j|jt|j|jt|j|j	t|jWdt
jtXdS(Nuwurua+(RRRRoR&RqtTrueRmRRGRtunlink(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyt	testAbless$

uwin32uno ttys on WindowscCsytdd}Wntk
r3|jdnX|j|jt|j|jttj	dkrdtj	krtj	j
dr|j|jtn|j|jt|j
dS(	Nu/dev/ttyuau
need /dev/ttyudarwinubsdusunosuaix(usunosuaix(RtEnvironmentErrortskipTestRRoR&RqRRLRMRNRmRGR(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestAblesOnTTY-s
cCsWxPdD]H}ytt|}Wntk
r3qX|j|jd|qWdS(NuuaUuwU+urwurtu%r is an invalid file mode(uuaUuwU+urwurt(RRRHRRX(RR$R((s,/usr/local/lib/python2.7/test/test_fileio.pyttestInvalidModeStringsAs


c
CszlxeddddddddddddgD]9}tt|d
}|j|j|dWdQXq.WWdtjjtrtjtnXdS(Nuwuwbuwb+urb+uw+buauabuab+ua+bururbur+bii(uwuwb(uwbuwb(uwb+urb+(uw+burb+(uauab(uabuab(uab+uab+(ua+buab+(ururb(urburb(urb+urb+(ur+burb+(RRRR$RtpathtexistsR(RtmodesR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestModeStringsLs		%cCs0tttd}|jtjtdS(Nuw(RtstrRRRR(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestUnicodeOpen[s
cCsytjd}Wn"tk
r7|jdtnXt|d}zI|jd|jttd}|j|j	dWdQXWdt
jtXdS(Nuasciiucould not encode %r to asciiuwR=urb(RtencodetUnicodeEncodeErrorRRRRR[RR7RR(RtfnR((s,/usr/local/lib/python2.7/test/test_fileio.pyt
testBytesOpenas


 cCs?d}|jtt|d|jtt|jdddS(Nufoobaruwuascii(RR(RR(Rtfn_with_NUL((s,/usr/local/lib/python2.7/test/test_fileio.pyttestConstructorHandlesNULCharspscCsd|jttd|jttttjdkr`ddl}|jt|j	tndS(Niuwin32i(
RRHRtOSErrorRRLRMtmsvcrtRTt
get_osfhandle(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyt
testInvalidFdus
cCsDddl}|jtt|jd|jtt|jddS(Nii(t	_testcapiRR(RtINT_MAXtINT_MIN(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestInvalidFd_overflow|scCsd}ytt|}Wnatk
r|}|jddkrt|}t|ksb||kry|jd|qyqnX|j|jd|dS(Nuqwertyiu&bad error message for invalid mode: %suno error for invalid mode: %s(RRRHtargsRRXR(Rtbad_modeRtmsgts((s,/usr/local/lib/python2.7/test/test_fileio.pyttestBadModeArguments
cCsttd}|jtttd|j|jd|jd|j|jd|j|j	dt
jd|jd|j|jd|j|j	dt
jd|jdS(Nuwi
iii(
RRRRRORRRRkR"RtSEEK_ENDR(RR((s,/usr/local/lib/python2.7/test/test_fileio.pyttestTruncates

cs/fd}z|WdtjtXdS(Ncsttd}|jttd|jttd}|jd}|ttdkr|jd|n|jdkrjd|jn|j	|jdkrjd|jn|jt
jjt}|dkrjd|ndS(	Nuwiur+iu(Read on file opened for update failed %ruFile pos after read wrong %du!File pos after ftruncate wrong %du"File size after ftruncate wrong %d(
RRRRRRR7RXRRkRRtgetsize(Rtdatatsize(R(s,/usr/local/lib/python2.7/test/test_fileio.pyt	bug801631s 


(RRR(RR((Rs,/usr/local/lib/python2.7/test/test_fileio.pyttestTruncateOnWindowsscCszttd}|jd|jttd}|jd|jttd}|j}|j|j|dWdytjtWnnXXdS(Nuwbtspamuabteggsurbtspameggs(R[RRRR7RRR(RRtd((s,/usr/local/lib/python2.7/test/test_fileio.pyt
testAppends




cCs|jttddddS(Nu1i(RR(R(R((s,/usr/local/lib/python2.7/test/test_fileio.pyttestInvalidInitsc	Cs~tdti}|j|jg|jttg|j|jg|jttdd|j|jgWdQXdS(Ntquietu/some/invalid/nameurt(RRRtwarningsRR(RRH(Rtw((s,/usr/local/lib/python2.7/test/test_fileio.pyttestWarningsscCsd}yt|WdQXWnttfk
r6nXttj}d|d<tdd|d|\}}d|krd|kpd	|kr|jd
|ndS(Nu.txttCtLC_CTYPEu-cuimport _io; _io.FileIO(%r)tenvuUnicodeEncodeErroru,IOError: [Errno 2] No such file or directoryu$IOError: [Errno 22] Invalid argumentuBad output: %r(RRRTtdictRtenvironRRX(RRWRt_tout((s,/usr/local/lib/python2.7/test/test_fileio.pyttest_surrogatess



csndtfdYdtffdYtjttj}|j|tj|dS(NtMyExceptioncBseZRS((RzR{(((s,/usr/local/lib/python2.7/test/test_fileio.pyRstMyFileIOcseZfdZRS(cs4|dkrdnt|j||S(Nunameublocked setting name(tsupert__setattr__(RRCtvalue(RR(s,/usr/local/lib/python2.7/test/test_fileio.pyRs(RzR{R((RR(s,/usr/local/lib/python2.7/test/test_fileio.pyRs(t	ExceptionRRR[t__file__R\RR(RR_((RRs,/usr/local/lib/python2.7/test/test_fileio.pyttestUnclosedFDOnExceptions
(RzR{RR|R}RLRMRRRRRRRR
RRRRRRRRR(((s,/usr/local/lib/python2.7/test/test_fileio.pyR~s"	$													cCs;ztttWdtjjtr6tjtnXdS(N(RRR~RRRRR(((s,/usr/local/lib/python2.7/test/test_fileio.pyt	test_mainsu__main__(t
__future__RRLRRVR|RtweakrefRt	functoolsRRttest.test_supportRRRRR	RR
Rttest.script_helperRt_ioR
RtTestCaseRR~RRz(((s,/usr/local/lib/python2.7/test/test_fileio.pyt<module>s$"		

Zerion Mini Shell 1.0