Current File : //opt/imh-python/lib/python2.7/test/test_file.pyc
�
��Wc@s?ddlmZddlZddlZddlZddlmZddlmZddlZddl	Z
ddlmZm
Z
ddlmZdejfd��YZd	efd
��YZdefd��YZd
ejfd��YZdefd��YZdefd��YZd�Zedkr;e�ndS(i����(tprint_functionN(tarray(tproxy(tTESTFNtrun_unittest(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((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pytsetUpscCs*|jr|jj�ntjt�dS(N(R	tclosetostremoveR(R
((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttearDowns	cCskt|j�}|jd�|j|jj�|j��|jj�d|_|jtt	|d�dS(Nt
teststringttell(
RR	twritetassertEqualRRtNonetassertRaisestReferenceErrortgetattr(R
tp((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestWeakRefss

	cCs"|j}|j|j|jdS(N(R	tnametmodetclosed(R
R	((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestAttributes&s	cCsq|jjd�|jj�tdd�}|jtd�|_|jj|�}|jd|j�| �dS(Nt12tbtxi
trbt
xxxxxxxxxx(	R	RRRRRtreadintoRttostring(R
tatn((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestReadinto-s
cCsctdd�}|jj�|jtd�|_t|jd�r_|jt|jj|�ndS(NRR i
trR#R"(	RR	RRRthasattrRt	TypeErrorR#(R
R%((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestReadinto_text6s

cCsgtddg�}|jj|�|jj�|jtd�|_|jj�}|j|d�dS(Nt1t2R!R(RR	t
writelinesRRRtreadR(R
tltbuf((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestWritelinesUserList>s
cCs&|jt|jjdddg�dS(Niii(RR*R	R.(R
((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestWritelinesIntegersGscCs2tdddg�}|jt|jj|�dS(Niii(RRR*R	R.(R
R0((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestWritelinesIntegersUserListKscCs<ddd��Y}|jt|jj|�|�g�dS(Nt	NonStringcBseZRS((t__name__t
__module__(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyR5Rs((RR*R	R.(R
R5((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestWritelinesNonStringPscCs�|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(R
R	((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyt
testErrorsXs	
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(R
tmethodst
methodnametargstmethod((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestMethodscs2											"cCs|jt|jj�dS(N(RR<R	R/(R
((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestReadWhenWriting�s(R6R7RRRRR'R+R2R3R4R8R>RSRT(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyRs															#tCAutoFileTestscBseZejZRS((R6R7tioR(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyRU�stPyAutoFileTestscBseZeej�ZRS((R6R7tstaticmethodtpyioR(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyRW�stOtherFileTestscBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCsZxSdD]K}y|jt|�}Wntk
r6qX|j�|jd|�qWdS(NR9taUswU+s%r is an invalid file mode(R9R[swU+(RRRMRtfail(R
RR	((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/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(RRRMRQtstrR\R(R
tbad_modeR	tmsgts((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/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(RRRR_tencodeRtintR/tdecodeR<R\R(R
RbR	tdRa((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestSetBufferSize�s



!cCs8tjt�|jtd�}z�|jd�|j�|jtd�}|jd�}|dkrz|jd|�n|j�dkr�|jd|j��n|j	�|j�dkr�|jd|j��n|j�tj
jt�}|dkr|jd	|�nWd|j�tjt�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
tunlinkRRRRR/R\RRGtpathtgetsize(R
R	tdatatsize((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyttestTruncateOnWindows�s(





cCs�d}d}|t|�s)td��|t|�}dddddd	g}d
dfdd fdd!fd
tddd�ffg}z&|jtd�}|j||�|j|�|j�xk|D]c\}}|jtd�}	t|	�|kr|j	dfnt
|	|�}
|
|�|	j�q�W|jtd�}	xt|�D]}t|	�qUW|jd�}y|	j
�}
Wntk
r�|j	d�nX|
|kr�|j	d|
|f�n|jd�}tddt|��}y|	j|�Wntk
r(|j	d�nX|j�}
|
|kr[|j	d|
|f�n|jd�}y|	jt|��}
Wntk
r�|j	d�nX|
|kr�|j	d|
|f�ny|	j�}Wntk
r�|j	d�nX||kr!|j	d|
|f�n|	j�|jtd�}	zex|	D]}
qGWy/|	j
�|	j|�|	j�|	j�Wntk
r�|j	d�nXWd|	j�XWdtjt�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!sBroken testfileisLreadline() after next() with supposedly empty iteration-buffer failed anywaysEreadline() after next() with empty buffer failed. Got %r, expected %rtsLreadinto() 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((((tlentAssertionErrorRRRRR.RRAR\RtrangetpopRBRMR#R$R/RCR
Rl(R
t
dataoffsettfillertnchunkst	testlinesROtbagRPRQR	tmethtittestlinetlineR1tlines((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyt
testIteration�s�		


	
	
	
	
	





(R6R7R]RcRiRqR�(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyRZ�s
				tCOtherFileTestscBseZejZRS((R6R7RVR(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyR�@stPyOtherFileTestscBseZeej�ZRS((R6R7RXRYR(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyR�CscCsAzttttt�Wdtjjt�r<tj	t�nXdS(N(
RRURWR�R�R
RmtexistsRRl(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyt	test_mainGs
	t__main__(t
__future__RRHR
tunittestRtweakrefRRVt_pyioRYttest.test_supportRRRtTestCaseRRURWRZR�R�R�R6(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_file.pyt<module>s$w�