관리-도구
편집 파일: test_unparse.pyo
� ��^c @ s� d d l Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d � Z d Z d Z d Z d Z d Z d Z d Z d e j f d � � YZ d e f d � � YZ d e f d � � YZ d � Z e d k r� e � n d S( i����N( t test_supportc C s( t | d � � } | j � } Wd QX| S( sn Read and return the contents of a Python source file (as a string), taking into account the file encoding.t rN( t opent read( t filenamet pyfilet source( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt read_pyfile s sQ def f(): for x in range(10): break else: y = 2 z = 3 sI def g(): while True: break else: y = 2 z = 3 sQ from . import fred from .. import barney from .australia import shrimp as prawns s @f1(arg) @f2 class Foo: pass s= if cond1: suite1 elif cond2: suite2 else: suite3 s, if cond1: suite1 elif cond2: suite2 sc try: suite1 except ex1: suite2 except ex2: suite3 else: suite4 finally: suite5 t ASTTestCasec B s e Z d � Z d d � Z RS( c C sD t j | � } t j | � } | j t j | � t j | � � d S( N( t astt dumpt assertEqual( t selft ast1t ast2t dump1t dump2( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt assertASTEqualM s t internalc C sl t | | d t j � } t j � } t j | | � | j � } t | | d t j � } | j | | � d S( Nt exec( t compileR t PyCF_ONLY_ASTt cStringIOt StringIOt unparset Unparsert getvalueR ( R t code1R R t unparse_buffert code2R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt check_roundtripR s ( t __name__t __module__R R ( ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyR L s t UnparseTestCasec B s� e Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( c C s | j d � d S( Ns del x, y, z( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_del_statement] s c C s | j d � | j d � d S( Ns 45 << 2s 13 >> 7( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_shifts` s c C s | j t � d S( N( R t for_else( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_for_elsed s c C s | j t � d S( N( R t while_else( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_while_elseg s c C sE | j d � | j d � | j d � | j d � | j d � d S( Ns (-1)**7s (-1.)**8s (-1j)**6s not True or Falses True or not False( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_unary_parensj s c C s | j d � d S( Ns 3 .__abs__()( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_integer_parensq s c C s8 | j d � | j d � | j d � | j d � d S( Nt 1e1000s -1e1000t 1e1000js -1e1000j( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_huge_floatt s c C s7 | j t t j d � � | j d t j d � d S( Ni s -(%s)( R t strt syst maxint( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_min_intz s c C sR | j d � | j d � | j d � | j d � | j d � | j d � d S( Nt 7js -7js -(7j)t 0js -0js -(0j)( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_imaginary_literals~ s c C sl | j d � | j d � | j d � | j d � | j d � | j d � | j d � | j d � d S( Ns -0s -(0)s -0b0s -(0b0)s -0o0s -(0o0)s -0x0s -(0x0)( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_negative_zero� s c C s | j d � d S( Ns (lambda: int)()( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_lambda_parentheses� s c C s | j d � | j d � d S( Ns 1 < 4 <= 5s a is b is c is not d( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_chained_comparisons� s c C s_ | j d � | j d � | j d � | j d � | j d � | j d � | j d � d S( Ns def f(): passs def f(a): passs def f(b = 2): passs def f(a, b): passs def f(a, b = 2): passs def f(a = 5, b = 2): passs def f(*args, **kwargs): pass( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_function_arguments� s c C s | j t � d S( N( R t relative_import( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_relative_import� s c C s | j d � d S( Ns b'123'( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_bytes� s c C s | j d � d S( Ns {'a', 'b', 'c'}( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_set_literal� s c C s | j d � d S( Ns {x for x in range(5)}( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_set_comprehension� s c C s | j d � d S( Ns {x: x*x for x in range(10)}( R ( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_dict_comprehension� s c C s | j t � d S( N( R t class_decorator( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_class_decorators� s c C s | j t � | j t � d S( N( R t elif1t elif2( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_elifs� s c C s | j t � d S( N( R t try_except_finally( R ( ( s0 /usr/lib64/python2.7/Demo/parser/test_unparse.pyt test_try_except_finally� s ( R R R"