HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/__pycache__/test_largefile.cpython-37.opt-2.pyc
B

��gS�@s�ddlZddlZddlZddlZddlmZmZmZmZddl	Z	ddl
ZdZGdd�d�Z
dd�ZGdd	�d	e
ej�ZGd
d�de
ej�Zdd
�Zedkr�e��dS)�N)�TESTFN�requires�unlink�
bigmemtestly*c@s^eZdZdd�Zedd��Zeeddd�dd	��Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dS)�
LargeFileTestc	Cs�tj�t�rd}nd}|�t|���}t�|���tj}|t	dkrHdS|dkrZ|�
d�|�d�|�t	�|�
d�|��|�
t�|���tjt	d�WdQRXdS)Nzr+bzw+b�r�z�a)�os�path�existsr�open�fstat�fileno�stat�ST_SIZE�size�write�seek�flush�assertEqual)�self�mode�fZcurrent_size�r�//usr/local/lib/python3.7/test/test_largefile.py�setUps



zLargeFileTest.setUpc	Cs:|�td��WdQRXt�t�tjdks6|�d��dS)N�wbrz0File was not truncated by opening with mode "wb")r
rr
rrZfailureException)�clsrrr�
tearDownClass(s
zLargeFileTest.tearDownClass�F)rZmemuseZdry_runc	CsH|�td��2}|�t|���td�|�|��td�WdQRXdS)N�rbr)r
rr�len�readr�tell)rZ_sizerrrr�test_large_read2szLargeFileTest.test_large_readcCs |�t�t�tjtd�dS)Nr)rr
rrrr)rrrr�test_osstat9szLargeFileTest.test_osstatc	Cs�|�td����}|�|��d�|�|�d�d�|�|��d�|�d�|�|��d�|�dd�|�|��d�|�d�|�|��d�|�dd�|�|��d�|�dd�|�|��d�|�dd�|�|��d�|�dd�|�|��tdd�|�dd�|�|��tdd	�|�tdd�|�|��d�|�t�|�|��t�|�|�d�d
�|�tdd�|�|�d�d�|�|��d�WdQRXdS)Nr!rrr�*�Tr i�����
r	)r
rrr$r#rr)rrrrr�test_seek_read<s8


zLargeFileTest.test_seek_readc	Cs|�td���}|�t�|��dd�d�|�t�|��dd�d�|�t�|��dd�d�|�t�|��dd�d�|�t�|��dd�tdd�|�t�|��dd�tdd�|�t�|��tdd�d�|�t�|��td�t�|�|�d�d	�WdQRXdS)
Nr!rr'rr(r i����r)r	)r
rrr
�lseekrrr#)rrrrr�
test_lseek[s"" zLargeFileTest.test_lseekc	Cs"|�td���
}t|d�s$t�d��|�dd�|�|��td�td}|�|�|�	�|�|��|�|�dd�|�|��|�|d8}|�d�|�	|�|�|��d�|�dd�|�|��|�|�d�|�	d�|�|��d�|�d�|�t
|���d�WdQRXdS)	Nzr+b�truncatez.open().truncate() not available on this systemrr rr)r')r
r�hasattr�unittest�SkipTestrrr$rr-r"r#)rrZnewsizerrr�
test_truncatehs,







zLargeFileTest.test_truncatec
CsBx<dD]4}|�td��}|�|�|�|���WdQRXqWdS)N)i���llr!)r
rrZ
assertTrue�seekable)r�posrrrr�
test_seekable�s

zLargeFileTest.test_seekableN)�__name__�
__module__�__qualname__r�classmethodrrrr%r&r*r,r1r4rrrrrs

rc	Cs�yddl}|�|j|j�Wnttfk
r4YnXtjdd�dksRtjdkrftddtt	��njt
tddd�}zHy |�d	�|�
d
�|��Wn"ttfk
r�t�d��YnXWd|��tt�XdS)Nr��win�darwinZ	largefilez-test requires %s bytes and a long time to runr)�	bufferingl�xz*filesystem does not have largefile support)�signal�SIGXFSZ�SIG_IGN�ImportError�AttributeError�sys�platformr�strrr
rrrr�OSError�
OverflowErrorr/r0�closer)r>rrrr�setUpModule�s"

rIc@seZdZeej�ZdS)�CLargeFileTestN)r5r6r7�staticmethod�ior
rrrrrJ�srJc@seZdZeej�ZdS)�PyLargeFileTestN)r5r6r7rK�pyior
rrrrrM�srMcCstt�dS)N)rrrrrr�tearDownModule�srO�__main__)r
rrCr/Ztest.supportrrrrrLZ_pyiorNrrrIZTestCaserJrMrOr5�mainrrrr�<module>s$