Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_zipfile64.cpython-39.opt-2.pyc

a

��g6�@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@s:eZdZdd�Zdd�Zdd�Ze�dd��Zd	d
�ZdS)�TestsWithSourceFilecCs^dd�td�D�}d�|��d�|_ttd��}|�|j�Wd�n1sP0YdS)Ncss|]}d|VqdS)zTest of zipfile line %d.N�)�.0�ir	r	�//usr/local/lib/python3.9/test/test_zipfile64.py�	<genexpr>�z,TestsWithSourceFile.setUp.<locals>.<genexpr>i@B�
�ascii�wb)�range�join�encode�data�openr�write)�selfZline_gen�fpr	r	r�setUpszTestsWithSourceFile.setUpcCs2t�|d|���}dt|j�}t��t}t|�D]N}|�d||j�|t��kr2t��t}t	d||ft
jd�t
j��q2Wd�n1s�0Yt�|d|��n}t|�D]T}|�
|�d|�|j�|t��kr�t��t}t	d||ft
jd�t
j��q�Wd�n1�s$0YdS)N�wlztestfn%dz/  zipTest still writing %d of %d, be patient...)�file�rz/  zipTest still reading %d of %d, be patient...)�zipfile�ZipFile�lenr�time�	monotonic�_PRINT_WORKING_MSG_INTERVALr�writestr�print�sys�
__stdout__�flush�assertEqual�read)r�f�compressionZzipfpZ	filecountZ	next_time�numr	r	r�zipTest%s4��*��zTestsWithSourceFile.zipTestcCsRt��*}|�|tj�|�|j�Wd�n1s60Y|�ttj�dS�N)rr.rZ
ZIP_STORED�assertFalse�closed�TESTFN2�rr+r	r	r�
testStoredDs*zTestsWithSourceFile.testStoredcCsRt��*}|�|tj�|�|j�Wd�n1s60Y|�ttj�dSr/)rr.r�ZIP_DEFLATEDr0r1r2r3r	r	r�testDeflatedLs*z TestsWithSourceFile.testDeflatedcCs(ttfD]}tj�|�rt�|�qdSr/)rr2�os�path�exists�remove)rZfnamer	r	r�tearDownUszTestsWithSourceFile.tearDownN)	�__name__�
__module__�__qualname__rr.r4rr6r;r	r	r	rrs	
rc@s$eZdZdd�Zdd�Zdd�ZdS)�
OtherTestscCs�tjtddd��X}d|_d}t|�D] }|�d|d|dd	�q$|�t|���|�Wd�n1sn0Ytjtd
d��^}|�t|���|�t|�D]0}|�	d|��
d�}|�|d|dd	�q�Wd�n1s�0YdS)
NrT��modeZ
allowZip64�d���foo%08d�%d��9r�rAr)rrr�debugrr$r)r �namelistr*�decode)r�zipf�numfilesr�zipf2�contentr	r	r�testMoreThan64kFiles\s2zOtherTests.testMoreThan64kFilesc	Cs|tjtddd���}d|_d}t|�D] }|�d|d|dd	�q$|�t|���|�|�	tj
�� |�d|d
�Wd�n1s�0Y|�t|���|�Wd�n1s�0Ytjtddd��|}d|_|�t|���|�|�	tj
�� |�d|d
�Wd�n1�s(0Y|�t|���|�Wd�n1�s\0Ytjtddd��p}d|_|�t|���|�d
}t||�D]"}|�d|d|dd	��q�|�t|���|�Wd�n1�s�0Ytjtdd��`}|�t|���|�t|�D]2}|�d|��d�}|�|d|dd	��q$Wd�n1�sn0YdS)NrFr@rBi��rDrErFrGr�aTrCrrHr)
rrrrIrr$r)r rJZassertRaisesZLargeZipFiler*rK)rrLrMrZ	numfiles2rNrOr	r	r�testMoreThan64kFilesAppendls6.204 4z%OtherTests.testMoreThan64kFilesAppendcCst�t�t�t�dSr/)r�unlinkrr2)rr	r	rr;�s
zOtherTests.tearDownN)r<r=r>rPrRr;r	r	r	rr?[s r?�__main__)�testrZrequiresrr7Zunittestr!r&�tempfilerZtest.supportrrr2r#ZTestCaserr?r<�mainr	r	r	r�<module>s�@5

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists