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_zipfile64.cpython-37.opt-2.pyc
B

��g��@s�ddlmZe�dd�ddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZedZ
dZGd	d
�d
ej�ZGdd�dej�Zed
kr�e��dS)�)�supportZextralargefilez>test requires loads of disk-space bytes and a long time to runN)�
TemporaryFile)�TESTFN�
requires_zlib�2�<c@s8eZdZdd�Zdd�Zdd�Zedd��Zd	d
�ZdS)�TestsWithSourceFilecCsFdd�td�D�}d�|��d�|_ttd�}|�|j�|��dS)Ncss|]}d|VqdS)zTest of zipfile line %d.N�)�.0�ir	r	�//usr/local/lib/python3.7/test/test_zipfile64.py�	<genexpr>sz,TestsWithSourceFile.setUp.<locals>.<genexpr>i@B�
�ascii�wb)�range�join�encode�data�openr�write�close)�selfZline_gen�fpr	r	r�setUps

zTestsWithSourceFile.setUpcCst�|d|�}dt|j�}t��t}xZt|�D]N}|�d||j�|t��kr2t��t}t	d||ft
jd�t
j��q2W|�
�t�|d|�}x`t|�D]T}|�|�d|�|j�|t��kr�t��t}t	d||ft
jd�t
j��q�W|�
�dS)N�wlztestfn%dz/  zipTest still writing %d of %d, be patient...)�file�rz/  zipTest still reading %d of %d, be patient...)�zipfile�ZipFile�lenr�timeZ	monotonic�_PRINT_WORKING_MSG_INTERVALr�writestr�print�sys�
__stdout__�flushr�assertEqual�read)r�fZcompressionZzipfpZ	filecountZ	next_timeZnumr	r	r�zipTest&s,zTestsWithSourceFile.zipTestc	Cs>t�� }|�|tj�|�|j�WdQRX|�ttj�dS)N)rr+rZ
ZIP_STORED�assertFalse�closed�TESTFN2)rr*r	r	r�
testStoredGszTestsWithSourceFile.testStoredc	Cs>t�� }|�|tj�|�|j�WdQRX|�ttj�dS)N)rr+rZZIP_DEFLATEDr,r-r.)rr*r	r	r�testDeflatedOsz TestsWithSourceFile.testDeflatedcCs,x&ttfD]}tj�|�r
t�|�q
WdS)N)rr.�os�path�exists�remove)rZfnamer	r	r�tearDownXszTestsWithSourceFile.tearDownN)	�__name__�
__module__�__qualname__rr+r/rr0r5r	r	r	rrs

!	rc@s$eZdZdd�Zdd�Zdd�ZdS)�
OtherTestscCs�tjtddd�}d|_d}x,t|�D] }|�d|d|dd	�q$W|�t|���|�|�	�tjtd
d�}|�t|���|�x<t|�D]0}|�
d|��d�}|�|d|dd	�q�W|�	�dS)
NrT)�mode�
allowZip64�di�zfoo%08dz%d��9r)r:r)rrr�debugrr#r(r �namelistrr)�decode)r�zipf�numfilesr�zipf2�contentr	r	r�testMoreThan64kFiles_s zOtherTests.testMoreThan64kFilesc	Cs�tjtddd�}d|_d}x,t|�D] }|�d|d|dd	�q$W|�t|���|�|�	tj
��|�d|d
�WdQRX|�t|���|�|��tjtddd�}d|_|�t|���|�|�	tj
��|�d|d
�WdQRX|�t|���|�|��tjtddd�}d|_|�t|���|�d
}x0t||�D]"}|�d|d|dd	��qHW|�t|���|�|��tjtdd�}|�t|���|�x>t|�D]2}|�d|��
d�}|�|d|dd	��q�W|��dS)NrF)r:r;r<i��zfoo%08dz%dr=r>��aTi�r)r:r)rrrr?rr#r(r r@ZassertRaisesZLargeZipFilerr)rA)rrBrCrZ	numfiles2rDrEr	r	r�testMoreThan64kFilesAppendqs> "z%OtherTests.testMoreThan64kFilesAppendcCst�t�t�t�dS)N)r�unlinkrr.)rr	r	rr5�s
zOtherTests.tearDownN)r6r7r8rFrIr5r	r	r	rr9^s$r9�__main__)ZtestrZrequiresrr1Zunittestr!r%ZtempfilerZtest.supportrrr.r"ZTestCaserr9r6�mainr	r	r	r�<module>sC;