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: 18.220.98.190
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_largefile.pyo
�
?��cc@s
dZddlmZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZddl
Z
ddlZy(ddlZejejej�ZWneefk
r�nXdZdejfd��YZd�Zed	kre�ndS(
s9Test largefile support on system where this makes sense.
i����(tprint_functionN(trun_unittesttTESTFNtverbosetrequirestunlinkI��t
LargeFileTestcBsDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s@Test that each file function works as expected for a large
    (i.e. > 2GB, do  we have to check > 4GB) files.

    NOTE: the order of execution of the test methods is important! test_seek
    must run first to create the test file. File cleanup must also be handled
    outside the test instances because of this.

    cCs�trtd�n|jtd���}|jd�|jd�|jt�|jd�|j�trytd�n|jt	j
|j��tj
td�WdQXdS(Ns3create large file via seek (may be sparse file) ...twbtzitascheck file size with os.fstati(RtprinttopenRtwritetseektsizetflushtassertEqualtostfstattfilenotstattST_SIZE(tselftf((s:/usr/local/python-2.7/lib/python2.7/test/test_largefile.pyt	test_seek&s






cCs;trtd�n|jtjt�tjtd�dS(Nscheck file size with os.stati(RR
RRRRRR(R((s:/usr/local/python-2.7/lib/python2.7/test/test_largefile.pyttest_osstat3s
cCs\trtd�n|jtd��1}|j|j�d�|j|jd�d�|j|j�d�|jd�|j|j�d�|jdd�|j|j�d�|jd�|j|j�d�|jdd�|j|j�d�|jdd�|j|j�d�|jdd�|j|j�d�|jdd�|j|j�tdd�|jd	d�|j|j�tdd
�|jtdd�|j|j�d�|jt�|j|j�t�|j|jd�d�|jtdd�|j|jd�d�|j|j�d�WdQXdS(Ns;play around with seek() and read() with the built largefiletrbiiRi*iTii����i
R	(	RR
RRRttelltreadR
R(RR((s:/usr/local/python-2.7/lib/python2.7/test/test_largefile.pyttest_seek_read8s<



c	Cs�trtd�n|jtd��]}|jtj|j�dd�d�|jtj|j�dd�d�|jtj|j�dd�d�|jtj|j�dd�d�|jtj|j�dd�tdd�|jtj|j�dd�tdd	�|jtj|j�tdd�d�|jtj|j�td�t�|j|j	d�d
�WdQXdS(Ns4play around with os.lseek() with the built largefileRii*iiTii����i
R	(
RR
RRRRtlseekRRR(RR((s:/usr/local/python-2.7/lib/python2.7/test/test_largefile.pyt
test_lseekYs
%%%%--*%cCs�trtd�n|jtd���}t|d�sItjd��n|jdd�|j|j	�t
d�t
d}|j|�|j�|j|j	�|�|jdd�|j|j	�|�|d8}|jd	�|j|�|jr|j|j	�d	�n|jdd�|j|j	�|�|jd�|jd�|jrx|j|j	�d�n|jd�|jt
|j��d�WdQXdS(
Nstry truncatesr+bttruncates.open().truncate() not available on this systemiiii
i*(RR
RRthasattrtunittesttSkipTestR
RRRR tnew_iotlenR(RRtnewsize((s:/usr/local/python-2.7/lib/python2.7/test/test_largefile.pyt
test_truncatehs4






	

	
cCsr|js|jd�nxRddd
fD]A}|jtd��'}|j|�|j|j��WdQXq)WdS(Ns$builtin file doesn't have seekable()iiiRI�i���I�I�I�(R$tskipTestRRR
t
assertTruetseekable(RtposR((s:/usr/local/python-2.7/lib/python2.7/test/test_largefile.pyt
test_seekable�s	
(	t__name__t
__module__t__doc__RRRRR'R,(((s:/usr/local/python-2.7/lib/python2.7/test/test_largefile.pyRs	
		!		$cCstjd dks"tjdkr<tddtt��n�ttddd�}y(|jd	�|jd
�|j	�Wn:t
tfk
r�|j�t
t�tjd��nX|j�tj�}xtjdftjd
ftdfgD]�\}}dtfd��Y}t|�|_|tk	|_|tj|_|j|d��|j|d��|j|d��|j|d��|td��,}t|d�r�|j|d��nWdQX|j|d��t
t�q�Wzt|�Wdt
t�XdS(Nitwintdarwint	largefiles-test requires %s bytes and a long time to runRt	bufferingiI�txs*filesystem does not have largefile supporttCtPytBuiltintTestCasecBseZRS((R-R.(((s:/usr/local/python-2.7/lib/python2.7/test/test_largefile.pyR8�sRRRRR R'R,(tsystplatformRtstrRRRR
RRtIOErrort
OverflowErrortcloseRR"R#t	TestSuitetiotpyioRtstaticmethodR$R-taddTestR!R(Rtsuitet_opentprefixR8((s:/usr/local/python-2.7/lib/python2.7/test/test_largefile.pyt	test_main�s@"




t__main__(R/t
__future__RRRR9R"ttest.test_supportRRRRRR@t_pyioRAtsignaltSIGXFSZtSIG_IGNt
oldhandlertImportErrortAttributeErrorRR8RRGR-(((s:/usr/local/python-2.7/lib/python2.7/test/test_largefile.pyt<module>s$({	0
© 2025 GrazzMean