HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/python3.6/test/__pycache__/test_largefile.cpython-36.pyc
3


 \Q�@s�dZddlZddlZddlZddlZddlmZmZmZm	Z	ddl
Z
ddlZdZ
Gdd�d�Zdd�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Zedkr�ej�dS)z9Test largefile support on system where this makes sense.
�N)�TESTFN�requires�unlink�
bigmemtestly*c@sbeZdZdZdd�Zedd��Zeeddd�d	d
��Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)�
LargeFileTestzUTest that each file function works as expected for large
    (i.e. > 2GB) files.
    cCs�tjjt�rd}nd}|jt|���}tj|j��tj}|t	dkrHdS|dkrZ|j
d�|jd�|jt	�|j
d�|j�|j
tj|j��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/lib64/python3.6/test_largefile.py�setUps



zLargeFileTest.setUpc	Cs:|jtd��WdQRXtjt�tjdks6|jd��dS)N�wbrz0File was not truncated by opening with mode "wb")r
rr
rrZfailureException)�clsrrr�
tearDownClass(s
zLargeFileTest.tearDownClass�F)rZmemuseZdry_runcCsH|jtd��2}|jt|j��td�|j|j�td�WdQRXdS)N�rbr)r
rr�len�readr�tell)rZ_sizerrrr�test_large_read2szLargeFileTest.test_large_readcCs |jtjt�tjtd�dS)Nr)rr
rrrr)rrrr�test_osstat9szLargeFileTest.test_osstatcCs�|jtd����}|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�WdQRXdS)Nr!rrr�*�Tr �
r	i����)r
rrr$r#rr)rrrrr�test_seek_read<s8


zLargeFileTest.test_seek_readcCs|jtd����}|jtj|j�dd�d�|jtj|j�dd�d�|jtj|j�dd�d�|jtj|j�dd�d�|jtj|j�dd�tdd�|jtj|j�d	d�tdd�|jtj|j�tdd�d�|jtj|j�td�t�|j|jd�d�WdQRXdS)
Nr!rr'rr(r r)r	i����)r
rrr
�lseekrrr#)rrrrr�
test_lseek[s"" zLargeFileTest.test_lseekcCs"|jtd���
}t|d�s$tjd��|jdd�|j|j�td�td}|j|�|j	�|j|j�|�|jdd�|j|j�|�|d8}|jd�|j	|�|j|j�d�|jdd�|j|j�|�|jd�|j	d�|j|j�d�|jd�|jt
|j��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<d
D]4}|jtd��}|j|�|j|j��WdQRXqWdS)Nr �rr!l���l�)r3r4r5)r
rrZ
assertTrue�seekable)r�posrrrr�
test_seekable�s

zLargeFileTest.test_seekableN)�__name__�
__module__�__qualname__�__doc__r�classmethodrrrr%r&r*r,r1r8rrrrrs

rcCs�yddl}|j|j|j�Wnttfk
r4YnXtjdd�dksRtjdkrftddtt	��njt
tddd�}zHy |jd	�|j
d
�|j�Wn"ttfk
r�tjd��YnXWd|j�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)rCrrrr�setUpModule�s"

rNc@seZdZeej�ZdS)�CLargeFileTestN)r9r:r;�staticmethod�ior
rrrrrO�srOc@seZdZeej�ZdS)�PyLargeFileTestN)r9r:r;rP�pyior
rrrrrR�srRcCstt�dS)N)rrrrrr�tearDownModule�srT�__main__)r<r
rrHr/Ztest.supportrrrrrQZ_pyiorSrrrNZTestCaserOrRrTr9�mainrrrr�<module>s $