← Back
Editing: test_zippath.cpython-38.pyc
U W[� � @ sd d Z ddlmZmZ ddlZddlZddlmZ ddlm Z ddl mZ dd� ZG d d � d e�Z dS )z0 Test cases covering L{twisted.python.zippath}. � )�absolute_import�divisionN)�AbstractFilePathTests)� ZipArchive)�_coerceToFilesystemEncodingc C s� t d| �} t d|�}t�|d��^}t�| �D ]L\}}}|D ]<}tj�||�}tj�||�t| �d d� }|�||� q:q,W 5 Q R X dS )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�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>- s �z*ZipFilePathTests.setUp.<locals>.<listcomp>) r �setUpr r r � nativecmnr r r �allr r r r r"