HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/python/test/__pycache__/test_zippath.cpython-38.pyc
U


W[�
�@sddZddlmZmZddlZddlZddlmZddlm	Z	ddl
mZdd�ZGd	d
�d
e�Z
dS)z0
Test cases covering L{twisted.python.zippath}.
�)�absolute_import�divisionN)�AbstractFilePathTests)�
ZipArchive)�_coerceToFilesystemEncodingc		Cs�td|�}td|�}t�|d��^}t�|�D]L\}}}|D]<}tj�||�}tj�||�t|�dd�}|�||�q:q,W5QRXdS)zI
    Create a zipfile on zfname, containing the contents of dirname'
    ��w�N)	r�zipfileZZipFile�os�walk�path�join�len�write)	�dirnameZzfnameZzf�rootZignored�files�fname�fspathZarcpath�r�B/usr/lib/python3/dist-packages/twisted/python/test/test_zippath.py�zipits

rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�ZipFilePathTestszk
    Test various L{ZipPath} path manipulations as well as reprs for L{ZipPath}
    and L{ZipArchive}.
    cs\t���t�j�jd�td�j��_t�jd��_�j�_�fdd��j	D��_	dS)N�.ziprcs g|]}|��j�jd��qS)r)�replace�cmn)�.0�x��selfrr�
<listcomp>-s�z*ZipFilePathTests.setUp.<locals>.<listcomp>)
r�setUprrr�	nativecmnrr
r�allrrrrr"'s

�zZipFilePathTests.setUpcCs�|j�d�}dtj�|jdtjd�f}|�t|�|�|j�t�	�tjdd�d}t
|�}|�d�}|�t|�|�dS)z�
        Make sure that invoking ZipPath's repr prints the correct class name
        and an absolute path to the zip file.
        �foo�ZipPath(%r)�.ziprr	N)r
�childr�abspathr#�sep�assertEqual�reprr�getcwdr)r r(�pathRepr�relativeCommon�relpathrrr�test_zipPathRepr1s���
z!ZipFilePathTests.test_zipPathReprcCsN|j�d��d��d�}d|jdtj�ddddg�}|�t|�|�dS)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.
        r%z..Zbarr&r'rN)r
r(r#rr*rr+r,)r r(r.rrr� test_zipPathReprParentDirSegmentGs
�z1ZipFilePathTests.test_zipPathReprParentDirSegmentcCspt|jd�}dtj�|jd�f}|�t|�|�|j�t��tj	dd�d}t|�}|�t|�|�dS)z�
        Make sure that invoking ZipArchive's repr prints the correct class
        name and an absolute path to the zip file.
        r'zZipArchive(%r)rr	N)
rr#rr
r)r+r,rr-r*)r r
r.r/r0rrr�test_zipArchiveReprSs���z$ZipFilePathTests.test_zipArchiveReprN)�__name__�
__module__�__qualname__�__doc__r"r1r2r3rrrrr"s

r)r7Z
__future__rrrr
Ztwisted.test.test_pathsrZtwisted.python.zippathrZtwisted.python.filepathrrrrrrr�<module>s