HEX
Server: nginx/1.24.0
System: Linux localhost 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64
User: www (1000)
PHP: 8.3.27
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: //usr/lib/python3/dist-packages/twisted/python/test/__pycache__/test_zippath.cpython-310.pyc
o

�b-
�@sTdZddlZddlZddlmZddlmZddlmZdd�Z	Gdd	�d	e�Z
dS)
z0
Test cases covering L{twisted.python.zippath}.
�N)�_coerceToFilesystemEncoding)�
ZipArchive)�AbstractFilePathTestsc	Cs�td|�}td|�}t�|d��5}t�|�D]&\}}}|D]}tj�||�}tj�||�t|�dd�}|�||�qqWd�dS1sHwYdS)zI
    Create a zipfile on zfname, containing the contents of dirname'
    ��w�N)	r�zipfile�ZipFile�os�walk�path�join�len�write)	�dirname�zfname�zf�root�ignored�files�fname�fspath�arcpath�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>0s z*ZipFilePathTests.setUp.<locals>.<listcomp>)
r�setUprrr�	nativecmnrrr�allr"rr"rr%*s
zZipFilePathTests.setUpcCs�|j�d�}d�tj�|jdtjd��}|�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.
        �fooz
ZipPath({!r})�.ziprrN)r�child�formatr
�abspathr&�sep�assertEqual�reprr�getcwdr)r#r*�pathRepr�relativeCommon�relpathrrr�test_zipPathRepr2s�
z!ZipFilePathTests.test_zipPathReprcCsJ|j�d��d��d�}d|jdtj�gd��}|�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(�..�barzZipPath(%r)r))rr(r5r6N)rr*r&r
r-r
r.r/)r#r*r1rrr� test_zipPathReprParentDirSegmentGs
�z1ZipFilePathTests.test_zipPathReprParentDirSegmentcCspt|jd�}d�tj�|jd��}|�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})rrN)rr&r+r
rr,r.r/rr0r-)r#rr1r2r3rrr�test_zipArchiveReprSsz$ZipFilePathTests.test_zipArchiveReprN)�__name__�
__module__�__qualname__�__doc__r%r4r7r8rrrrr$sr)r<r
r�twisted.python.filepathr�twisted.python.zippathr�twisted.test.test_pathsrrrrrrr�<module>s