Sindbad~EG File Manager
�
'Μg�$ � �J � d Z ddlZddlmZmZ ej
d� ZddlZddlZddl Z ddl
Z
dZdZ G d� de
j � Zdd �Z G d
� dej � Z G d� d
ej � Z G d� dej � Zedk( r ej* � yy)z%
Tests for uu module.
Nick Mathewson
� N)� os_helper�warnings_helper�uus7 The symbols on top of your keyboard are !@#$%^&*()_+|~
sO M5&AE('-Y;6)O;',@;VX@=&]P(&]F('EO=7(@:V5Y8F]A<F0@87)E("% (R0E
*7B8J*"E?*WQ^"@ c �. � � e Zd ZdZ d� fd� Zd� Z� xZS )�FakeIOz�Text I/O implementation using an in-memory buffer.
Can be a used as a drop-in replacement for sys.stdin and sys.stdout.
c �� �� t t | � t j � |||�� || _ || _ |r>t |t � st |� }| j |� | j d� y y )N)�encoding�errors�newliner )�superr �__init__�io�BytesIO� _encoding�_errors�
isinstance�str�write�seek)�self�
initial_valuer r
r � __class__s ��)/usr/local/lib/python3.12/test/test_uu.pyr
zFakeIO.__init__ sk �� �
�f�d�$�R�Z�Z�\�.6�,2�-4� %� 6� "��������m�S�1� #�M� 2�
��J�J�}�%��I�I�a�L� � c � � | j � | j j � j | j | j
� S �N)�flush�buffer�getvalue�decoder r �r s r r zFakeIO.getvalue- s3 � ��
�
���{�{�#�#�%�,�,�T�^�^�T�\�\�J�Jr )� zutf-8�strict�
)�__name__�
__module__�__qualname__�__doc__r
r �
__classcell__)r s @r r r s �� �� 3:�*.��Kr r c � � |r-t d| |fz d� t j dd� z dz }|S t d| |fz d� t z dz }|S )Nzbegin %03o %s
�ascii� � `s
`
end
s
end
)�bytes�encodedtext�replace)�mode�filename�backtick�ress r �encodedtextwrappedr5 2 sn � ���&�$��)9�9�7�C��"�"�4��.�/�1>�?��
�J� �&�$��)9�9�7�C���*�+���Jr c �T � e Zd Zd� Zej
d� � Zd� Zd� Zd� Z d� Z
d� Zy) �UUTestc �& � t j t � }t j � }t j ||d� | j |j
� t dd� � t j t � }t j � }t j ||dd� | j |j
� t dd� � t j t � }t j � }t j ||dd�� | j |j
� t ddd� � | j t � 5 t j ||ddd� d d d � y # 1 sw Y y xY w)N�t1� � T�r3 )
r r � plaintextr �encode�assertEqualr r5 �assertRaises� TypeError)r �inp�outs r �test_encodezUUTest.test_encode= s
� ��j�j��#���j�j�l��
� � �#�s�D�!��������);�E�4�)H�I��j�j��#���j�j�l��
� � �#�s�D�%�(��������);�E�4�)H�I��j�j��#���j�j�l��
� � �#�s�D�4� �0��������);�E�4��)N�O�
�
�
�y�
)��I�I�c�3��e�T�2� *�
)�
)�s �$F�Fc �� � dD ]� }t j t dd|�� � }t j � }t j ||� | j |j
� t � t j dt dd|�� z � }t j � }t j ||� | j |j
� t � �� y )N)TFr: r9 r<