ó
v®¸Qc           @   s{  d  Z  d d l m Z d d l Z d d l m Z m Z d d l m	 Z	 d d l
 m Z m Z m Z m Z d d l m Z d	 d
 „ Z d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d S(   s'    Test suite for the code in fixer_util i   (   t   supportiÿÿÿÿN(   t   Nodet   Leaf(   t
   fixer_util(   t   Attrt   Namet   Callt   Comma(   t   tokeni    c         C   s@   t  j |  ƒ } x! t | ƒ D] } | j d } q Wd  | _ | S(   Ni    (   R    t   parse_stringt   ranget   childrent   Nonet   parent(   t   codet   strip_levelst   treet   i(    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   parse   s
    	t   MacroTestCasec           B   s   e  Z d  „  Z RS(   c         C   sG   t  | t t f ƒ r- t t j j | ƒ } n  |  j t | ƒ | ƒ d  S(   N(	   t
   isinstancet   tuplet   listR   R   t   symst   simple_stmtt   assertEqualt   str(   t   selft   nodet   string(    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt	   assertStr   s    (   t   __name__t
   __module__R   (    (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR      s   t   Test_is_tuplec           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   t  j t | d d ƒƒ S(   NR   i   (   R   t   is_tupleR   (   R   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR"       s    c         C   sr   |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ d  S(   Ns   (a, b)s   (a, (b, c))s   ((a, (b, c)),)s   (a,)s   ()(   t
   assertTrueR"   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt
   test_valid#   s
    c         C   s0   |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ d  S(   Ns   (a)s   ('foo') % (b, c)(   t   assertFalseR"   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_invalid*   s    (   R   R    R"   R$   R&   (    (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR!      s   		t   Test_is_listc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   t  j t | d d ƒƒ S(   NR   i   (   R   t   is_listR   (   R   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR(   0   s    c         C   sr   |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ d  S(   Ns   []s   [a]s   [a, b]s   [a, [b, c]]s   [[a, [b, c]],](   R#   R(   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR$   3   s
    c         C   s   |  j  |  j d ƒ ƒ d  S(   Ns   []+[](   R%   R(   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR&   :   s    (   R   R    R(   R$   R&   (    (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR'   /   s   		t	   Test_Attrc           B   s   e  Z d  „  Z d „  Z RS(   c         C   sZ   t  d d d ƒ} |  j t t d ƒ t d ƒ ƒ d ƒ |  j t | t d ƒ ƒ d ƒ d  S(   Ns   foo()R   i   t   at   bs   a.bs   foo().b(   R   R   R   R   (   R   t   call(    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test?   s    %c         C   s5   t  t d ƒ t d ƒ ƒ } |  j t | ƒ t ƒ d  S(   NR*   R+   (   R   R   R   t   typeR   (   R   t   attr(    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_returnsE   s    (   R   R    R-   R0   (    (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR)   >   s   	t	   Test_Namec           B   s   e  Z d  „  Z RS(   c         C   sL   |  j  t d ƒ d ƒ |  j  t d ƒ d ƒ |  j  t d d d ƒd ƒ d  S(   NR*   s   foo.foo().bart   prefixR+   t   ba(   R   R   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR-   K   s    (   R   R    R-   (    (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR1   J   s   t	   Test_Callc           B   s    e  Z d d d  „ Z d „  Z RS(   c         C   sf   g  } t  | t ƒ rP x+ | D]# } | j | ƒ | j t ƒ  ƒ q W| j ƒ  n  t t | ƒ | | ƒ S(   s   Help the next test(   R   R   t   appendR   t   popR   R   (   R   t   namet   argsR2   R   t   arg(    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   _CallR   s    c      	   C   s"  d  t t j d ƒ t t j d ƒ t t j d ƒ g t t j d ƒ t t j d ƒ t t j d ƒ t t j d ƒ g t t j d ƒ t t j d d d ƒg g } |  j |  j d	 ƒ d
 ƒ |  j |  j d | d ƒ d ƒ |  j |  j d | d ƒ d ƒ |  j |  j d | d d d ƒd ƒ d  S(   Ni   i   i   i   R+   t   jR2   t    t   As   A()s   b(1,2,3)s   a.b().cs   a.b().c(1,3,2,4)t   ds    d(b, j)(   R   R   R   t   NUMBERt   STRINGR   R:   (   R   t   kids(    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR-   \   s    !-  N(   R   R    R   R:   R-   (    (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyR4   Q   s   
t   Test_does_tree_importc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   sP   t  j | | ƒ } | r | Sx- | j D]" } |  j | | ƒ } | r& | Sq& Wd  S(   N(   R   t   find_bindingR   t   _find_bind_rec(   R   R7   R   t   ct   child(    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyRD   k   s      c         C   s1   t  | ƒ } |  j d | ƒ } t j | | | ƒ S(   Nt   start(   R   RD   R   t   does_tree_import(   R   t   packageR7   R   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyRH   t   s    c      	   C   s  d d d d d f } xk | D]c \ } } } |  j | | | d	 | ƒ } |  j | ƒ |  j | | | d	 | ƒ } |  j | ƒ q Wd d d d d d d f } xk | D]c \ } } } |  j | | | d	 | ƒ } |  j | ƒ |  j | | | d	 | ƒ } |  j | ƒ q¥ Wd  S(   NR*   s   from a import bs   a.ds   from a.d import bs   d.as   from d.a import bs   import bs   import b, c, ds   
s   from a import at   xs   from x import as   from x import b, c, a, ds   x.bs   from x.b import as   from x.b import b, c, a, ds   import as   import b, c, a, d(   R*   R*   s   from a import b(   s   a.dR*   s   from a.d import b(   s   d.aR*   s   from d.a import b(   NR*   s   import b(   NR*   s   import b, c, d(   R*   R*   s   from a import a(   RJ   R*   s   from x import a(   RJ   R*   s   from x import b, c, a, d(   s   x.bR*   s   from x.b import a(   s   x.bR*   s   from x.b import b, c, a, d(   NR*   s   import a(   NR*   s   import b, c, a, d(   R   RH   R%   R#   (   R   R   t   failing_testsRI   R7   t   import_t   nt   passing_tests(    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   try_withz   s,    		c         C   s   |  j  d ƒ d  S(   Ns   def foo():
	bar.baz()
	start=3(   RO   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_in_function“   s    (   R   R    RD   RH   RO   RP   (    (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyRB   j   s   				t   Test_find_bindingc           B   sì   e  Z d 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 d „  Z d „  Z d „  Z d „  Z RS(   c         C   s   t  j | t | ƒ | ƒ S(   N(   R   RC   R   (   R   R7   R   RI   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyRC   —   s    c         C   sš   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S(   NR*   s   a = bs   a = [b, c, d]s	   a = foo()s   a = foo().foo.foo[6][foo]s   foo = as   foo = (a, b, c)(   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_simple_assignmentš   s    c         C   sš   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S(   NR*   s   (a,) = bs   (a, b, c) = [b, c, d]s   (c, (d, a), b) = foo()s   (a, b) = foo().foo[6][foo]s   (foo, b) = (b, a)s   (foo, (b, c)) = (a, b, c)(   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_tuple_assignment¢   s    c         C   sš   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S(   NR*   s   [a] = bs   [a, b, c] = [b, c, d]s   [c, [d, a], b] = foo()s   [a, b] = foo().foo[a][foo]s   [foo, b] = (b, a)s   [foo, [b, c]] = (a, b, c)(   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_list_assignmentª   s    c         C   sh   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ d  S(   NR*   s	   foo.a = 5s
   foo[a] = 5s
   foo(a) = 5s   foo(a, b) = 5(   R%   RC   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_invalid_assignments²   s    c         C   sh   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S(   NR*   s   import as   import b, c, a, ds   import bs   import b, c, d(   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_simple_import¸   s    c         C   sÌ   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d	 ƒ ƒ d  S(
   NR*   s   from x import as   from a import as   from x import b, c, a, ds   from x.b import as   from x.b import b, c, a, ds   from a import bs   from a.d import bs   from d.a import b(   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_from_import¾   s    c         C   sh   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S(   NR*   s   import b as as   import b as a, c, a as f, ds   import a as fs   import b, c as f, d as e(   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_import_asÈ   s    c         C   s³   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S(	   NR*   s   from x import b as as   from x import g as a, d as bs   from x.b import t as as   from x.b import g as a, ds   from a import b as ts   from a.d import b as ts   from d.a import b as t(   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_from_import_asÎ   s    c         C   sn   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d d ƒ ƒ |  j |  j d d d ƒ ƒ d  S(   NR+   s   import bs   import b, c, dRE   (   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_simple_import_with_package×   s    c         C   s8  |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ |  j  |  j d d	 d ƒ ƒ |  j  |  j d d
 d ƒ ƒ |  j |  j d d d ƒ ƒ |  j |  j d d d ƒ ƒ |  j |  j d d d ƒ ƒ |  j |  j d d d ƒ ƒ d  S(   NR*   s   from x import aRJ   s   from a import as   from x import *s   from x import b, c, a, ds   from x.b import as   x.bs   from x.b import *s   from x.b import b, c, a, ds   from a import bs   from a.d import bs   a.ds   from d.a import bs   from x.y import *s   a.b(   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_from_import_with_packageÝ   s    c         C   sX   |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ d  S(   NR*   s   import b.c as as   b.cs   import a as ft   f(   R%   RC   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_import_as_with_packageê   s    c         C   sÈ   |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ |  j  |  j d d d	 ƒ ƒ |  j  |  j d d d
 ƒ ƒ d  S(   NR*   s   from x import b as aRJ   s   from x import g as a, d as bs   from x.b import t as as   x.bs   from x.b import g as a, ds   from a import b as tR+   t   t(   R%   RC   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt    test_from_import_as_with_packageï   s    c         C   sÒ   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d	 } |  j |  j d | ƒ ƒ d  S(
   NR*   s   def a(): passs   def a(b, c, d): passs   def a(): b = 7s   def d(b, (c, a), e): passs   def d(a=7): passs   def d(a): passs   def d(): a = 7sG   
            def d():
                def a():
                    pass(   R#   RC   R%   (   R   t   s(    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_function_defû   s    c         C   s  |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d	 ƒ ƒ |  j |  j d d
 ƒ ƒ |  j |  j d d ƒ ƒ d } |  j |  j d | ƒ ƒ d  S(   NR*   s   class a: passs   class a(): passs   class a(b): passs   class a(b, c=8): passs   class d: passs   class d(a): passs   class d(b, a=7): passs   class d(b, *a): passs   class d(b, **a): passs   class d: a = 7sK   
            class d():
                class a():
                    pass(   R#   RC   R%   (   R   R`   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_class_def
  s    c         C   s³   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S(	   NR*   s   for a in r: passs   for a, b in r: passs   for (a, b) in r: passs   for c, (a,) in r: passs   for c, (a, b) in r: passs   for c in r: a = cs   for c in a: pass(   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_for  s    c         C   sü   d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d	 } |  j |  j d | ƒ ƒ d  S(
   NsM   
            for b in r:
                for a in b:
                    passR*   sP   
            for b in r:
                for a, c in b:
                    passsR   
            for b in r:
                for (a, c) in b:
                    passsP   
            for b in r:
                for (a,) in b:
                    passsU   
            for b in r:
                for c, (a, d) in b:
                    passsN   
            for b in r:
                for c in b:
                    a = 7sN   
            for b in r:
                for c in b:
                    d = asN   
            for b in r:
                for c in a:
                    d = 7(   R#   RC   R%   (   R   R`   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_for_nested%  s     c         C   s6   |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S(   NR*   s   if b in r: a = cs   if a in r: d = e(   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_ifV  s    c         C   sB   d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d  S(   NsL   
            if b in r:
                if c in d:
                    a = cR*   sL   
            if b in r:
                if c in d:
                    c = a(   R#   RC   R%   (   R   R`   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_if_nestedZ  s    c         C   s6   |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S(   NR*   s   while b in r: a = cs   while a in r: d = e(   R#   RC   R%   (   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt
   test_whileg  s    c         C   sB   d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d  S(   NsR   
            while b in r:
                while c in d:
                    a = cR*   sR   
            while b in r:
                while c in d:
                    c = a(   R#   RC   R%   (   R   R`   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_while_nestedk  s    c         C   s€   d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d  S(   NsQ   
            try:
                a = 6
            except:
                b = 8R*   sQ   
            try:
                b = 8
            except:
                a = 6sƒ   
            try:
                b = 8
            except KeyError:
                pass
            except:
                a = 6sQ   
            try:
                b = 8
            except:
                b = 6(   R#   RC   R%   (   R   R`   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_try_exceptx  s    c         C   sÝ   d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d  S(	   Ns›   
            try:
                try:
                    a = 6
                except:
                    pass
            except:
                b = 8R*   s›   
            try:
                b = 8
            except:
                try:
                    a = 6
                except:
                    passs›   
            try:
                b = 8
            except:
                try:
                    pass
                except:
                    a = 6sÕ   
            try:
                try:
                    b = 8
                except KeyError:
                    pass
                except:
                    a = 6
            except:
                passsÕ   
            try:
                pass
            except:
                try:
                    b = 8
                except KeyError:
                    pass
                except:
                    a = 6sQ   
            try:
                b = 8
            except:
                b = 6s  
            try:
                try:
                    b = 8
                except:
                    c = d
            except:
                try:
                    b = 6
                except:
                    t = 8
                except:
                    o = y(   R#   RC   R%   (   R   R`   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_try_except_nested—  s    		c         C   s€   d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d  S(   Ns|   
            try:
                c = 6
            except:
                b = 8
            finally:
                a = 9R*   sR   
            try:
                b = 8
            finally:
                a = 6sR   
            try:
                b = 8
            finally:
                b = 6s|   
            try:
                b = 8
            except:
                b = 9
            finally:
                b = 6(   R#   RC   R%   (   R   R`   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_try_except_finallyä  s    c         C   sa   d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d  S(   Nsú   
            try:
                c = 6
            except:
                b = 8
            finally:
                try:
                    a = 9
                except:
                    b = 9
                finally:
                    c = 9R*   s   
            try:
                b = 8
            finally:
                try:
                    pass
                finally:
                    a = 6sž   
            try:
                b = 8
            finally:
                try:
                    b = 6
                finally:
                    b = 7(   R#   RC   R%   (   R   R`   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_try_except_finally_nested  s    		N(   R   R    R   RC   RR   RS   RT   RU   RV   RW   RX   RY   RZ   R[   R]   R_   Ra   Rb   Rc   Rd   Re   Rf   Rg   Rh   Ri   Rj   Rk   Rl   (    (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyRQ   –   s2   						
												1						M	!t   Test_touch_importc           B   s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s9   t  d ƒ } t j d  d | ƒ |  j t | ƒ d ƒ d  S(   Ns   """foo"""
bar()t   foos   """foo"""
import foo
bar()

(   R   R   t   touch_importR   R   R   (   R   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_after_docstring*  s    c         C   s9   t  d ƒ } t j d  d | ƒ |  j t | ƒ d ƒ d  S(   Ns   """foo"""
import bar
bar()Rn   s'   """foo"""
import bar
import foo
bar()

(   R   R   Ro   R   R   R   (   R   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_after_imports/  s    c         C   s9   t  d ƒ } t j d  d | ƒ |  j t | ƒ d ƒ d  S(   Ns   bar()Rn   s   import foo
bar()

(   R   R   Ro   R   R   R   (   R   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_beginning4  s    c         C   s9   t  d ƒ } t j d d | ƒ |  j t | ƒ d ƒ d  S(   Ns   bar()t   htmlt   escapes   from html import escape
bar()

(   R   R   Ro   R   R   (   R   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyRW   9  s    c         C   s9   t  d ƒ } t j d  d | ƒ |  j t | ƒ d ƒ d  S(   Ns   bar()t   cgis   import cgi
bar()

(   R   R   Ro   R   R   R   (   R   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_name_import>  s    (   R   R    Rp   Rq   Rr   RW   Rv   (    (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyRm   (  s
   				t   Test_find_indentationc           B   s   e  Z d  „  Z d „  Z RS(   c         C   sQ   t  j } t d ƒ } |  j | | ƒ d ƒ t d ƒ } |  j | | ƒ d ƒ d  S(   Ns   node()u    t    (   R   t   find_indentationR   R   (   R   t   fiR   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_nothingE  s
    	c         C   s‘   t  j } t d ƒ } |  j | | ƒ d ƒ |  j | | j d j d j d ƒ d ƒ t d ƒ } |  j | | j d j d j d ƒ d ƒ d  S(   Ns   def f():
    x()u    i    i   i   u       s   def f():
    x()
    y()(   R   Ry   R   R   R   (   R   Rz   R   (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   test_simpleL  s    	+(   R   R    R{   R|   (    (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyRw   C  s   	(   t   __doc__Rx   R    t   os.patht   ost   lib2to3.pytreeR   R   t   lib2to3R   t   lib2to3.fixer_utilR   R   R   R   t   lib2to3.pgen2R   R   t   TestCaseR   R!   R'   R)   R1   R4   RB   RQ   Rm   Rw   (    (    (    s-   /sys/lib/python2.7/lib2to3/tests/test_util.pyt   <module>   s$   "	,ÿ “