%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/python/test/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/python/test/__pycache__/test_zipstream.cpython-312.pyc |
� Ϫ�f// � �� � d Z ddlZddlZddlZddlmZ ddlmZmZ ddl m Z G d� d� Z G d� d ee j � Z G d � dee j � Z G d� d e j � Zy)z' Tests for L{twisted.python.zipstream} � N)�md5)�filepath� zipstream)�unittestc �L � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd � Zd� Z y) �FileEntryMixinz? File entry classes should behave as file-like objects c � � | j � }t j |d| j � 5 }|j d|� ddd� t j |d� }|j d� S # 1 sw Y �0xY w)z6 Return an appropriate zip file entry �w�contentN�r)�mktemp�zipfile�ZipFile�compression�writestrr �ChunkingZipFile�readfile)�self�contents�filename�zs �D/usr/lib/python3/dist-packages/twisted/python/test/test_zipstream.py�getFileEntryzFileEntryMixin.getFileEntry sk � � �;�;�=�� �_�_�X�s�D�,<�,<� =� ,�� �J�J�y�(�+� ,��%�%�h��4���z�z�)�$�$� ,� ,�s �A4�4A=c � � | j d� 5 }| j |j � � ddd� y# 1 sw Y yxY w)zK zip files should not be ttys, so isatty() should be false � N)r �assertFalse�isatty�r � fileEntrys r �test_isattyzFileEntryMixin.test_isatty s@ � � � � �r� "� 1�i����Y�-�-�/�0� 1� 1� 1�s � ;�Ac � � | j d� 5 }| j |j � ddd� | j j � y# 1 sw Y �%xY w)zd The C{closed} attribute should reflect whether C{close()} has been called. r N)r r �closed� assertTruer s r �test_closedzFileEntryMixin.test_closed'