CasperSecurity

Current Path : /lib/python3/dist-packages/twisted/python/test/__pycache__/
Upload File :
Current File : //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
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY