%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/python/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/python/test/__pycache__/test_zippath.cpython-312.pyc

�

Ϫ�f?��v�dZddlmZddlZddlZddlmZddlmZddl	m
Z
mZddlm
Z
dd�ZGd	�d
e
�Zy)z0
Test cases covering L{twisted.python.zippath}.
�)�annotationsN)�Union)�_coerceToFilesystemEncoding)�
ZipArchive�ZipPath)�AbstractFilePathTestsc��td|�}td|�}tj|d�5}tj|�D]n\}}}|D]c}tj
j
||�}	tj
j
||�t|�dzd}
|j|	|
��e�p	ddd�y#1swYyxYw)zI
    Create a zipfile on zfname, containing the contents of dirname'
    ��w�N)	r�zipfile�ZipFile�os�walk�path�join�len�write)�dirname�zfname�coercedDirname�
coercedZfname�zf�root�ignored�files�fname�fspath�arcpaths           �B/usr/lib/python3/dist-packages/twisted/python/test/test_zippath.py�zipitr!s���1��W�=�N�/��F�;�M�	�����	,�	*��
�W�W�^�
$�		*�
�����
*�������d�E�2���'�'�,�,�t�U�3�C��L�1�4D�4F�G�������)�
*�	*�	*�	*�	*�s�BC�C	c�N�eZdZUdZded<ded<dd�Zdd�Zdd�Zdd�Zdd	�Z	y
)�ZipFilePathTestszk
    Test various L{ZipPath} path manipulations as well as reprs for L{ZipPath}
    and L{ZipArchive}.
    zZipArchive[bytes]rrc��tj|�t|j|jdz�t	d|j�|_t
|jdz�|_|j|_|jD�cgc]+}|j|j|jdz���-c}|_	ycc}w)Ns.zipr
)r�setUpr!�cmnr�	nativecmnrrr�all�replace)�self�xs  r r%zZipFilePathTests.setUp.s����#�#�D�)�
�d�h�h����7�*�+�4�R����B����t�x�x�'�1�2��	��I�I��	�EI�X�X�N��A�I�I�d�h�h����7�(:�;�N����Ns�0C	c��|j|jjd�jd�|jjd��y)zF
        L{ZipPath.sibling} returns a path at the same level.
        �one�twoN)�assertEqualr�child�sibling)r*s r �test_siblingzZipFilePathTests.test_sibling6s:��	
���������/�7�7��>��	�	���PU�@V�W�c��|jjd�}djtjj	|j
dztjzdz��}|jt|�|�|j
jtj�tjzdd�dz}t|�}|jd�}|jt|�|�y)z�
        Make sure that invoking ZipPath's repr prints the correct class name
        and an absolute path to the zip file.
        �fooz
ZipPath({!r})�.zipr
rN)rr0�formatr�abspathr'�sepr/�reprr)�getcwdr)r*r0�pathRepr�relativeCommon�relpaths     r �test_zipPathReprz!ZipFilePathTests.test_zipPathRepr<s���
@D�y�y���u�?U��"�)�)��G�G�O�O�D�N�N�V�3�b�f�f�<�u�D�E�
��
	
����e��h�/����/�/��	�	��b�f�f�0D�b�!�L�v�U���^�,���
�
�e�$��	
����e��h�/r3c��|jjd�jd�jd�}d|jdztjjgd��zz}|j
t|�|�y)z�
        The repr of a ZipPath with C{".."} in the internal part of its path
        includes the C{".."} rather than applying the usual parent directory
        meaning.
        r5�..�barzZipPath(%r)r6)r
r5rArBN)rr0r'rr9rr/r:)r*r0r<s   r � test_zipPathReprParentDirSegmentz1ZipFilePathTests.test_zipPathReprParentDirSegmentQsk���	�	����&�,�,�T�2�8�8��?�� ��N�N�V�#�b�f�f�k�k�2J�&K�K�
��	
����e��h�/r3c��t|jdz�}djtjj|jdz��}|j
t|�|�|jjtj�tjzdd�dz}t|�}|j
t|�|�y)z�
        Make sure that invoking ZipArchive's repr prints the correct class
        name and an absolute path to the zip file.
        r6zZipArchive({!r})r
rN)rr'r7rrr8r/r:r)r;r9)r*rr<r=r>s     r �test_zipArchiveReprz$ZipFilePathTests.test_zipArchiveRepr]s���
�$�.�.�6�1�2��%�,�,�R�W�W�_�_�T�^�^�f�=T�-U�V��	
����d��X�.����/�/��	�	��b�f�f�0D�b�!�L�v�U���^�,��	
����g���1r3N)�return�None)
�__name__�
__module__�__qualname__�__doc__�__annotations__r%r2r?rCrE�r3r r#r#%s0���
��
��O�X�0�*
0�2r3r#)r�str | bytesrrNrFrG)rK�
__future__rrr
�typingr�twisted.python.filepathr�twisted.python.zippathrr�twisted.test.test_pathsrr!r#rMr3r �<module>rTs5���#�	���?�6�9�*�&H2�,�H2r3

Zerion Mini Shell 1.0