Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.144.163.15
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_file.pyc
�
?��cc@sOddlmZddlZddlZddlZddlmZddlmZddlZddl	Z
ddlmZm
Z
ddlmZddlmZdejfd	��YZd
efd��YZdefd
��YZdejfd��YZdefd��YZdefd��YZd�ZedkrKe�ndS(i����(tprint_functionN(tarray(tproxy(tTESTFNtrun_unittest(tsupport(tUserListt
AutoFileTestscBs}eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�ZRS(
cCs|jtd�|_dS(Ntwb(topenRtf(tself((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pytsetUpscCs*|jr|jj�ntjt�dS(N(R
tcloseRtunlinkR(R((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttearDowns	cCskt|j�}|jd�|j|jj�|j��|jj�d|_|jtt	|d�dS(Nt
teststringttell(
RR
twritetassertEqualRR
tNonetassertRaisestReferenceErrortgetattr(Rtp((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestWeakRefss

	cCs"|j}|j|j|jdS(N(R
tnametmodetclosed(RR
((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestAttributes's	cCsq|jjd�|jj�tdd�}|jtd�|_|jj|�}|jd|j�| �dS(Nt12tbtxi
trbt
xxxxxxxxxx(	R
RR
RR	RtreadintoRttostring(Rtatn((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestReadinto.s
cCsctdd�}|jj�|jtd�|_t|jd�r_|jt|jj|�ndS(NRR i
trR#R"(	RR
R
R	RthasattrRt	TypeErrorR#(RR%((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestReadinto_text7s

cCsgtddg�}|jj|�|jj�|jtd�|_|jj�}|j|d�dS(Nt1t2R!R(RR
t
writelinesR
R	RtreadR(Rtltbuf((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestWritelinesUserList?s
cCs&|jt|jjdddg�dS(Niii(RR*R
R.(R((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestWritelinesIntegersHscCs2tdddg�}|jt|jj|�dS(Niii(RRR*R
R.(RR0((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestWritelinesIntegersUserListLscCs<ddd��Y}|jt|jj|�|�g�dS(Nt	NonStringcBseZRS((t__name__t
__module__(((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyR5Ss((RR*R
R.(RR5((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestWritelinesNonStringQscCs�|j}|j|jt�|j|j��|j|j�t|d�rm|jt	t
f|jd�n|j�|j
|j�dS(NR#t(R
RRRtassertFalsetisattyRR)RtIOErrorR*R#R
t
assertTrue(RR
((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyt
testErrorsYs	
cCsiddfddfddfddfddfddfddfd	dfd
dfddfddfd
gffddfg
}tjjd�s�|jddf�n|jjddd�|j|jj�x9|D]1\}}t	|j|�}|j
t||�q�W|j|jjddd�d�yddWn)|j|jjtj
��d�nXdS(NtfilenotflushR;tnextR/RR9treadlinet	readlinestseekiRR.t__iter__tatheosttruncatei((((((R9(((i((R9(((tsystplatformt
startswithtappendR
t__exit__RR=RRRt
ValueErrorRtexc_info(Rtmethodst
methodnametargstmethod((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestMethodsds2											"cCs|jt|jj�dS(N(RR<R
R/(R((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestReadWhenWriting�s(R6R7RRRRR'R+R2R3R4R8R>RSRT(((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyRs															#tCAutoFileTestscBseZejZRS((R6R7tioR	(((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyRU�stPyAutoFileTestscBseZeej�ZRS((R6R7tstaticmethodtpyioR	(((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyRW�stOtherFileTestscBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCstjt�dS(N(RRR(R((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyR�scCsp|jtd�j�xSdD]K}y|jt|�}Wntk
rLqX|j�|jd|�qWdS(NRR9taUswU+s%r is an invalid file mode(R9R[swU+(R	RR
RMtfail(RRR
((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestModeStrings�s


cCs�d}y|jt|�}Wnatk
r}|jddkr�t|�}t|kse||kr||jd|�q|q�nX|j�|jd|�dS(Ntqwertyis&bad error message for invalid mode: %ssno error for invalid mode: %s(R	RRMRQtstrR\R
(Rtbad_modeR
tmsgts((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestBadModeArgument�s
cCs�x�d	D]�}y�|jtd|�}|jt|�jd��|j�|j�|jtd|�}t|j�jd��}|j�|j�Wn0t	k
r�}|j
d|t|�f�nX|j||�qWdS(
Ni����iiiRtasciiR!s error setting buffer size %d: %s(i����iii(R	RRR_tencodeR
tintR/tdecodeR<R\R(RRbR
tdRa((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestSetBufferSize�s



!cCs|jtd�}z�|jd�|j�|jtd�}|jd�}|dkrm|jd|�n|j�dkr�|jd|j��n|j�|j�dkr�|jd|j��n|j�tj	j
t�}|dkr|jd	|�nWd|j�XdS(
NRt12345678901srb+it12345s(Read on file opened for update failed %rsFile pos after read wrong %ds!File pos after ftruncate wrong %ds"File size after ftruncate wrong %d(R	RRR
R/R\RRGtostpathtgetsize(RR
tdatatsize((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyttestTruncateOnWindows�s$



cCs�d}d}|t|�s)td��|t|�}dddddd	g}d
dfddfdd fd
tddd�ffg}|jtd�}|j||�|j|�|j�x_|D]W\}}|jtd�}	|jt	|	�|�t
|	|�}
|
|�|	j�q�W|jtd�}	xt|�D]}t	|	�qFW|jd�}y|	j
�}
Wntk
r�|jd�nX|
|kr�|jd|
|f�n|jd�}tddt|��}y|	j|�Wntk
r|jd�nX|j�}
|
|krL|jd|
|f�n|jd�}y|	jt|��}
Wntk
r�|jd�nX|
|kr�|jd|
|f�ny|	j�}Wntk
r�|jd�nX||kr|jd|
|f�n|	j�|jtd�}	zex|	D]}
q8Wy/|	j
�|	j|�|	j�|	j�Wntk
r�|jd�nXWd|	j�XdS(!Ni@sham
s*dataoffset must be multiple of len(filler)sspam, spam and eggs
seggs, spam, ham and spam
ssaussages, spam, spam and eggs
sspam, ham, spam and eggs
s(spam, spam, spam, spam, spam, ham, spam
swonderful spaaaaaam.
RBR/RCR#Rt idRR!isLreadline() after next() with supposedly empty iteration-buffer failed anywaysEreadline() after next() with empty buffer failed. Got %r, expected %rssLreadinto() after next() with supposedly empty iteration-buffer failed anywaysEreadinto() after next() with empty buffer failed. Got %r, expected %rsHread() after next() with supposedly empty iteration-buffer failed anywaysAread() after next() with empty buffer failed. Got %r, expected %rsMreadlines() after next() with supposedly empty iteration-buffer failed anywaysFreadlines() after next() with empty buffer failed. Got %r, expected %rs'read* failed after next() consumed file((((tlentAssertionErrorRR	RRR.R
RRARtrangetpopRBRMR\R#R$R/RC(Rt
dataoffsettfillertnchunkst	testlinesROtbagRPRQR
tmethtittestlinetlineR1tlines((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyt
testIteration�s�		


	
	
	
	
	





(R6R7RR]RcRiRqR�(((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyRZ�s					tCOtherFileTestscBseZejZRS((R6R7RVR	(((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyR�?stPyOtherFileTestscBseZeej�ZRS((R6R7RXRYR	(((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyR�BscCsttttt�dS(N(RRURWR�R�(((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyt	test_mainFs	t__main__(t
__future__RRHRltunittestRtweakrefRRVt_pyioRYttest.supportRRttestRRtTestCaseRRURWRZR�R�R�R6(((s5/usr/local/python-2.7/lib/python2.7/test/test_file.pyt<module>s&w�	
© 2025 GrazzMean