Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/python/test/__pycache__/test_zippath.cpython-39.pyc
Ðазад
a k�h- � @ sT d Z ddlZddlZddlmZ ddlmZ ddlmZ dd� Z G dd � d e�Z dS ) z0 Test cases covering L{twisted.python.zippath}. � N)�_coerceToFilesystemEncoding)� ZipArchive)�AbstractFilePathTestsc C s� t d| �} t d|�}t�|d��h}t�| �D ]L\}}}|D ]<}tj�||�}tj�||�t| �d d� }|�||� q:q,W d � n1 s�0 Y dS )zI Create a zipfile on zfname, containing the contents of dirname' � �w� N) r �zipfile�ZipFile�os�walk�path�join�len�write) �dirnameZzfname�zf�rootZignored�files�fname�fspathZarcpath� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/python/test/test_zippath.py�zipit s �r c @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd S )�ZipFilePathTestszk Test various L{ZipPath} path manipulations as well as reprs for L{ZipPath} and L{ZipArchive}. c s\ t �� � t� j� jd � td� j�� _t� jd �� _� j� _� fdd�� j D �� _ d S )N� .zipr c s g | ]}|� � j� jd ��qS )r )�replace�cmn)�.0�x��selfr r � <listcomp>0 � z*ZipFilePathTests.setUp.<locals>.<listcomp>) r �setUpr r r � nativecmnr r r �allr r r r r# * s zZipFilePathTests.setUpc C s� | j �d�}d�tj �| jd tj d ��}| �t|�|� | j� t� � tj dd�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})�.zipr r N)r �child�formatr �abspathr$ �sep�assertEqual�reprr �getcwdr )r r( �pathRepr�relativeCommon�relpathr r r �test_zipPathRepr2 s � z!ZipFilePathTests.test_zipPathReprc C sJ | j �d��d��d�}d| jd tj�g d�� }| �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&