File: //usr/local/lib/python3.7/test/__pycache__/test_uu.cpython-37.pyc
B
��g � @ s� d Z ddlZddlmZ ddlZddlZddlZddlZddlZdZ dZ
G dd� dej�Zdd d
�Z
G dd� dej�ZG d
d� dej�ZG dd� dej�Zedkr�e�� dS )z%
Tests for uu module.
Nick Mathewson
� N)�supports7 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 s* e Zd ZdZd
� fdd� Zdd � Z� ZS )�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.
� �utf-8�strict�
c sV t t| �jt�� |||d� || _|| _|rRt|t�s>t|�}| � |� | �
d� d S )N)�encoding�errors�newliner )�superr �__init__�io�BytesIO� _encoding�_errors�
isinstance�str�write�seek)�selfZ
initial_valuer r r
)� __class__� �(/usr/local/lib/python3.7/test/test_uu.pyr s
zFakeIO.__init__c C s | � � | j�� �| j| j�S )N)�flush�buffer�getvalue�decoder r )r r r r r , s zFakeIO.getvalue)r r r r )�__name__�
__module__�__qualname__�__doc__r r �
__classcell__r r )r r r s
r Fc C sF |r(t d| |f d�t�dd� d }nt d| |f d�t d }|S )Nzbegin %03o %s
�ascii� � `s
`
end
s
end
)�bytes�encodedtext�replace)�mode�filename�backtickZresr r r �encodedtextwrapped1 s $r+ c @ s<