Your IP : 216.73.216.213
�
��f� c @ s d Z d d l Z d d l m Z d d l Z d d l Z d d l Z d d l m Z d d l Z d Z d Z
Gd d � d e j � Z d d
� Z
Gd d � d e j � Z Gd
d � d e j � Z Gd d � d e j � Z d d � Z e d k r e � n d S( u%
Tests for uu module.
Nick Mathewson
i N( u support( u BytesIOs5 The smooth-scaled python crept over the sleeping dog
sK M5&AE('-M;V]T:"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P
(:6YG(&1O9PH c sD | Ee Z d Z d Z d d d d � f d d � Z d d � Z � S(
u FakeIOu� Text I/O implementation using an in-memory buffer.
Can be a used as a drop-in replacement for sys.stdin and sys.stdout.
u u utf-8u strictu
c s� t t | � j t j � d | d | d | �| | _ | | _ | r� t | t � sd t | � } n | j | � | j
d � n d S( Nu encodingu errorsu newlinei ( u superu FakeIOu __init__u iou BytesIOu _encodingu _errorsu
isinstanceu stru writeu seek( u selfu
initial_valueu encodingu errorsu newline( u __class__( u1 /opt/alt/python33/lib64/python3.3/test/test_uu.pyu __init__ s
u FakeIO.__init__c C s) | j � | j j � j | j | j � S( N( u flushu bufferu getvalueu decodeu _encodingu _errors( u self( ( u1 /opt/alt/python33/lib64/python3.3/test/test_uu.pyu getvalue+ s
u FakeIO.getvalue( u __name__u
__module__u __qualname__u __doc__u __init__u getvalue( u
__locals__( ( u __class__u1 /opt/alt/python33/lib64/python3.3/test/test_uu.pyu FakeIO s
u FakeIOc C s t d | | f d � t d S( Nu begin %03o %s
u asciis
end
( u bytesu encodedtext( u modeu filename( ( u1 /opt/alt/python33/lib64/python3.3/test/test_uu.pyu encodedtextwrapped0 s u encodedtextwrappedc B sD | Ee Z d Z d d � Z d d � Z d d � Z d d � Z d S(
u UUTestc C s� t j t � } t j � } t j | | d � | j | j � t d d � � t j t � } t j � } t j | | d d � | j | j � t d d � � d S( Nu t1i� i� ( u iou BytesIOu plaintextu uuu encodeu assertEqualu getvalueu encodedtextwrapped( u selfu inpu out( ( u1 /opt/alt/python33/lib64/python3.3/test/test_uu.pyu test_encode6 s u UUTest.test_encodec C s� t j t d d � � } t j � } t j | | � | j | j � t � t j d d t d d � � } t j � } t j | | � | j | j � t � d S( Ni� u t1s( UUencoded files may contain many lines,
s% even some that have 'begin' in them.
( u iou BytesIOu encodedtextwrappedu uuu decodeu assertEqualu getvalueu plaintext( u selfu inpu out( ( u1 /opt/alt/python33/lib64/python3.3/test/test_uu.pyu test_decode@ s u UUTest.test_decodec C s� t j d t � } t j � } y! t j | | � | j d � Wn>