Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_zipfile64.cpython-312.pyc

�

'Μg#��"�ddlmZejdd�ddlZddlZddlZddlZddlmZddl	m
Z
ddl	mZe
jZedzZ
d	ZGd
�dej�ZGd�d
ej�Zedk(rej&�yy)�)�support�extralargefilez>test requires loads of disk-space bytes and a long time to runN)�
TemporaryFile)�	os_helper)�
requires_zlib�2�<c�>�eZdZd�Zd�Zd�Ze�d��Zd�Zy)�TestsWithSourceFilec�r�d�td�D�}dj|�jd�|_y)Nc3�&K�|]	}d|z���y�w)zTest of zipfile line %d.N�)�.0�is  �0/usr/local/lib/python3.12/test/test_zipfile64.py�	<genexpr>z,TestsWithSourceFile.setUp.<locals>.<genexpr> s����K�N�q�.��2�N�s�i@B�
�ascii)�range�join�encode�data)�self�line_gens  r�setUpzTestsWithSourceFile.setUps+��K�E�'�N�K���I�I�h�'�.�.�w�7��	�c��tj|d|�5}dt|j�z}t	j
�tz}t|�D]�}|jd|z|j�|t	j
�ks�:t	j
�tz}td||fztj��tjj���	ddd�tj|d|�5}t�D]�}|j|jd|z�|j�t	j
�ks�It	j
�tz}td||fztj��tjj���|j|j!��ddd�y#1swY��xYw#1swYyxYw)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�assertIsNone�testzip)r�f�compression�zipfp�	filecount�	next_time�nums       r�zipTestzTestsWithSourceFile.zipTest#s~��
�_�_�Q��[�
1�U�"�S����^�3�I����(�+F�F�I��Y�'�����z�C�/����;����� 0�0� $��� 0�3N� N�I��E��)�$�%�,/�N�N�<��N�N�(�(�*�(�2�$�_�_�Q��[�
1�U��Y�'��� � ����J��,<�!=�t�y�y�I����� 0�0� $��� 0�3N� N�I��E��)�$�%�,/�N�N�<��N�N�(�(�*�(�
���e�m�m�o�.�2�
1�%2�
1��$2�
1�s'�A8G$�AG$�AG0�!A:G0�$G-�0G9c��t�5}|j|tj�|j	|j
�ddd�|jttj�y#1swY�.xYw�N)rr6r!�
ZIP_STORED�assertFalse�closed�TESTFN2�rr0s  r�
testStoredzTestsWithSourceFile.testStoredEsT���_���L�L��G�.�.�/����Q�X�X�&��	
���W�g�0�0�1��_���<A4�4A=c��t�5}|j|tj�|j	|j
�ddd�|jttj�y#1swY�.xYwr8)rr6r!�ZIP_DEFLATEDr:r;r<r=s  r�testDeflatedz TestsWithSourceFile.testDeflatedMsT���_���L�L��G�0�0�1����Q�X�X�&��	
���W�g�2�2�3��_�r?c�6�tjt�yr8)r�unlinkr<�rs r�tearDownzTestsWithSourceFile.tearDownVs������!rN)	�__name__�
__module__�__qualname__rr6r>rrBrFrrrrrs-��8�
 /�D2��_�4��4�"rrc��eZdZd�Zd�Zd�Zy)�
OtherTestsc�v�tjtdd��5}d|_d}t	|�D] }|jd|zd|dzd	zz��"|j
t|j��|�ddd�tjtd
��5}|j
t|j���t	|�D]@}|jd|z�jd�}|j
|d|dzd	zz��B	ddd�y#1swY��xYw#1swYyxYw)
NrT��mode�
allowZip64�d���foo%08d�%d��9r �rNr)r!r"�TESTFN�debugrr'r,r#�namelistr-�decode)r�zipf�numfilesr�zipf2�contents      r�testMoreThan64kFileszOtherTests.testMoreThan64kFiles[s���_�_�V�#�$�
?�4��D�J�'�H��8�_���
�
�i�!�m�T�Q��T�B�Y�-?�@�%����S�����1�8�<�@��_�_�V�#�
.�%����S����!1�2�H�=��8�_���*�*�Y��]�3�:�:�7�C��� � ��$�!�Q�$��)�*<�=�%�/�
.�@�
?��/�
.�s�A!D#�!A8D/�#D,�/D8c�~�tjtdd��5}d|_d}t	|�D] }|jd|zd|dzd	zz��"|j
t|j��|�|jtj�5|jd|zd
�ddd�|j
t|j��|�ddd�tjtdd��5}d|_|j
t|j���|jtj�5|jd|zd
�ddd�|j
t|j��|�ddd�tjtdd��5}d|_|j
t|j���d
}t	||�D] }|jd|zd|dzd	zz��"|j
t|j��|�ddd�tjtd��5}|j
t|j���t	|�D]@}|jd|z�jd�}|j
|d|dzd	zz��B	ddd�y#1swY��BxYw#1swY��xYw#1swY���xYw#1swY��}xYw#1swY��xYw#1swYyxYw)NrFrMrPi��rRrSrTrUr�aTrQr rVr)
r!r"rWrXrr'r,r#rY�assertRaises�LargeZipFiler-rZ)rr[r\r�	numfiles2r]r^s       r�testMoreThan64kFilesAppendz%OtherTests.testMoreThan64kFilesAppendks|��
�_�_�V�#�%�
@�D��D�J�$�H��8�_���
�
�i�!�m�T�Q��T�B�Y�-?�@�%����S�����1�8�<��"�"�7�#7�#7�8��
�
�i�(�2�C�8�9����S�����1�8�<�A��_�_�V�#�%�
@�D��D�J����S�����1�8�<��"�"�7�#7�#7�8��
�
�i�(�2�C�8�9����S�����1�8�<�A��_�_�V�#�$�
?�4��D�J����S�����1�8�<�(�I��8�Y�/���
�
�i�!�m�T�Q��T�B�Y�-?�@�0����S�����1�9�=�
@��_�_�V�#�
.�%����S����!1�2�I�>��9�%���*�*�Y��]�3�:�:�7�C��� � ��$�!�Q�$��)�*<�=�&�/�
.�'9�8��
A�
@��9�8��A�
@��@�
?��/�
.�sc�BL�K3�31L�AL�L
�.1L�BL'�1A8L3�3K=	�8L�L
�
L	�L�L$�'L0�3L<c�h�tjt�tjt�yr8)rrDrWr<rEs rrFzOtherTests.tearDown�s������ �����!rN)rGrHrIr_rerFrrrrKrKZs��>� >�@"rrK�__main__)�testr�requiresr!�unittestr$r)�tempfiler�test.supportrrrWr<r&�TestCaserrKrG�mainrrr�<module>ros����
�����H��
��
�"�"�&�	�	�	��
�3�,��!��:"�(�+�+�:"�z3"��"�"�3"�j�z���H�M�M�O�r

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