
müYøR  ã               @   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	 d
 „ Z Gd d „  d e j ƒ Z Gd d „  d e j ƒ Z Gd d „  d e j ƒ Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z Gd d „  d e j ƒ Z Gd d „  d e j ƒ Z Gd d „  d e j ƒ Z Gd d „  d e j ƒ Z d S)z' Test suite for the code in fixer_util é   )Úsupporté    N)ÚNodeÚLeaf)Ú
fixer_util)ÚAttrÚNameÚCallÚComma)Útokenc             C   s@   t  j |  ƒ } x! t | ƒ D] } | j d } q Wd  | _ | S)Nr   )r   Zparse_stringÚrangeÚchildrenÚparent)ÚcodeÚstrip_levelsZtreeÚi© r   úJ/build/mts/release/bora-5583004/publish/lin64/lib64/python3.5/test_util.pyÚparse   s
    	r   c               @   s   e  Z d  Z d d „  Z d S)ÚMacroTestCasec             C   sD   t  | t t f ƒ r* t t j j | ƒ } |  j t | ƒ | ƒ d  S)N)	Ú
isinstanceÚtupleÚlistr   r   ZsymsZsimple_stmtÚassertEqualÚstr)ÚselfÚnodeÚstringr   r   r   Ú	assertStr   s    zMacroTestCase.assertStrN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s   r   c               @   s4   e  Z d  Z d d „  Z d d „  Z d d „  Z d S)ÚTest_is_tuplec             C   s   t  j t | d d ƒƒ S)Nr   é   )r   Úis_tupler   )r   r   r   r   r   r$       s    zTest_is_tuple.is_tuplec             C   sr   |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ d  S)Nz(a, b)z(a, (b, c))z((a, (b, c)),)z(a,)z())Ú
assertTruer$   )r   r   r   r   Ú
test_valid#   s
    zTest_is_tuple.test_validc             C   s0   |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ d  S)Nz(a)z('foo') % (b, c))ÚassertFalser$   )r   r   r   r   Útest_invalid*   s    zTest_is_tuple.test_invalidN)r   r    r!   r$   r&   r(   r   r   r   r   r"      s   r"   c               @   s4   e  Z d  Z d d „  Z d d „  Z d d „  Z d S)ÚTest_is_listc             C   s   t  j t | d d ƒƒ S)Nr   r#   )r   Úis_listr   )r   r   r   r   r   r*   0   s    zTest_is_list.is_listc             C   sr   |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ |  j  |  j d ƒ ƒ d  S)Nz[]z[a]z[a, b]z[a, [b, c]]z[[a, [b, c]],])r%   r*   )r   r   r   r   r&   3   s
    zTest_is_list.test_validc             C   s   |  j  |  j d ƒ ƒ d  S)Nz[]+[])r'   r*   )r   r   r   r   r(   :   s    zTest_is_list.test_invalidN)r   r    r!   r*   r&   r(   r   r   r   r   r)   /   s   r)   c               @   s(   e  Z d  Z d d „  Z d d „  Z d S)Ú	Test_Attrc             C   sZ   t  d d d ƒ} |  j t t d ƒ t d ƒ ƒ d ƒ |  j t | t d ƒ ƒ d ƒ d  S)Nzfoo()r   r#   ÚaÚbza.bzfoo().b)r   r   r   r   )r   Úcallr   r   r   Útest?   s    %zTest_Attr.testc             C   s5   t  t d ƒ t d ƒ ƒ } |  j t | ƒ t ƒ d  S)Nr,   r-   )r   r   r   Útyper   )r   Úattrr   r   r   Útest_returnsE   s    zTest_Attr.test_returnsN)r   r    r!   r/   r2   r   r   r   r   r+   >   s   r+   c               @   s   e  Z d  Z d d „  Z d S)Ú	Test_Namec             C   sL   |  j  t d ƒ d ƒ |  j  t d ƒ d ƒ |  j  t d d d ƒd ƒ d  S)Nr,   zfoo.foo().barÚprefixr-   Zba)r   r   )r   r   r   r   r/   K   s    zTest_Name.testN)r   r    r!   r/   r   r   r   r   r3   J   s   r3   c               @   s.   e  Z d  Z d d d d „ Z d d „  Z d S)Ú	Test_CallNc             C   sc   g  } t  | t ƒ rM x+ | D]# } | j | ƒ | j t ƒ  ƒ q W| j ƒ  t t | ƒ | | ƒ S)zHelp the next test)r   r   Úappendr
   Úpopr	   r   )r   ÚnameÚargsr4   r   Úargr   r   r   Ú_CallR   s    
zTest_Call._Callc          	   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)Nr   r#   é   é   r-   Újr4   ú ÚAzA()zb(1,2,3)za.b().cza.b().c(1,3,2,4)Údz d(b, j))r   r   ÚNUMBERÚSTRINGr   r;   )r   Zkidsr   r   r   r/   \   s    !-  zTest_Call.test)r   r    r!   r;   r/   r   r   r   r   r5   Q   s   
r5   c               @   s@   e  Z d  Z d d „  Z d d „  Z d d „  Z d d „  Z d	 S)
ÚTest_does_tree_importc             C   sP   t  j | | ƒ } | r | Sx- | j D]" } |  j | | ƒ } | r& | Sq& Wd  S)N)r   Úfind_bindingr   Ú_find_bind_rec)r   r8   r   ÚcZchildr   r   r   rF   k   s      z$Test_does_tree_import._find_bind_recc             C   s1   t  | ƒ } |  j d | ƒ } t j | | | ƒ S)NÚstart)r   rF   r   Údoes_tree_import)r   Úpackager8   r   r   r   r   r   rI   t   s    z&Test_does_tree_import.does_tree_importc          	   C   sì   d } xk | D]c \ } } } |  j  | | | d	 | ƒ } |  j | ƒ |  j  | | | d	 | ƒ } |  j | ƒ q Wd  } xk | D]c \ } } } |  j  | | | d	 | ƒ } |  j | ƒ |  j  | | | d	 | ƒ } |  j | ƒ q Wd  S)!Nr,   úfrom a import búa.dúfrom a.d import búd.aúfrom d.a import búimport búimport b, c, dÚ
úfrom a import aÚxúfrom x import aúfrom x import b, c, a, dúx.búfrom x.b import aúfrom x.b import b, c, a, dúimport aúimport b, c, a, d©r,   r,   rK   ©rL   r,   rM   ©rN   r,   rO   ©Nr,   rP   ©Nr,   rQ   )r\   r]   r^   r_   r`   ©r,   r,   rS   ©rT   r,   rU   ©rT   r,   rV   ©rW   r,   rX   ©rW   r,   rY   ©Nr,   rZ   ©Nr,   r[   )ra   rb   rc   rd   re   rf   rg   )rI   r'   r%   )r   r   Zfailing_testsrJ   r8   Úimport_ÚnZpassing_testsr   r   r   Útry_withz   s,              zTest_does_tree_import.try_withc             C   s   |  j  d ƒ d  S)Nzdef foo():
	bar.baz()
	start=3)rj   )r   r   r   r   Útest_in_function“   s    z&Test_does_tree_import.test_in_functionN)r   r    r!   rF   rI   rj   rk   r   r   r   r   rD   j   s   	rD   c               @   s?  e  Z d  Z d d d „ Z d d „  Z d d „  Z d d	 „  Z d
 d „  Z d d „  Z d d „  Z	 d d „  Z
 d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d d „  Z d  d! „  Z d" d# „  Z d$ d% „  Z d& d' „  Z d( d) „  Z d* d+ „  Z d, d- „  Z d. d/ „  Z d0 d1 „  Z d2 d3 „  Z d S)4ÚTest_find_bindingNc             C   s   t  j | t | ƒ | ƒ S)N)r   rE   r   )r   r8   r   rJ   r   r   r   rE   —   s    zTest_find_binding.find_bindingc             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,   za = bza = [b, c, d]z	a = foo()za = foo().foo.foo[6][foo]zfoo = azfoo = (a, b, c))r%   rE   r'   )r   r   r   r   Útest_simple_assignmentš   s    z(Test_find_binding.test_simple_assignmentc             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,   z(a,) = bz(a, b, c) = [b, c, d]z(c, (d, a), b) = foo()z(a, b) = foo().foo[6][foo]z(foo, b) = (b, a)z(foo, (b, c)) = (a, b, c))r%   rE   r'   )r   r   r   r   Útest_tuple_assignment¢   s    z'Test_find_binding.test_tuple_assignmentc             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,   z[a] = bz[a, b, c] = [b, c, d]z[c, [d, a], b] = foo()z[a, b] = foo().foo[a][foo]z[foo, b] = (b, a)z[foo, [b, c]] = (a, b, c))r%   rE   r'   )r   r   r   r   Útest_list_assignmentª   s    z&Test_find_binding.test_list_assignmentc             C   sh   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ d  S)Nr,   z	foo.a = 5z
foo[a] = 5z
foo(a) = 5zfoo(a, b) = 5)r'   rE   )r   r   r   r   Útest_invalid_assignments²   s    z*Test_find_binding.test_invalid_assignmentsc             C   sh   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S)Nr,   zimport azimport b, c, a, dzimport bzimport b, c, d)r%   rE   r'   )r   r   r   r   Útest_simple_import¸   s    z$Test_find_binding.test_simple_importc             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,   zfrom x import azfrom a import azfrom x import b, c, a, dzfrom x.b import azfrom x.b import b, c, a, dzfrom a import bzfrom a.d import bzfrom d.a import b)r%   rE   r'   )r   r   r   r   Útest_from_import¾   s    z"Test_find_binding.test_from_importc             C   sh   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S)Nr,   zimport b as azimport b as a, c, a as f, dzimport a as fzimport b, c as f, d as e)r%   rE   r'   )r   r   r   r   Útest_import_asÈ   s    z Test_find_binding.test_import_asc             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,   zfrom x import b as azfrom x import g as a, d as bzfrom x.b import t as azfrom x.b import g as a, dzfrom a import b as tzfrom a.d import b as tzfrom d.a import b as t)r%   rE   r'   )r   r   r   r   Útest_from_import_asÎ   s    z%Test_find_binding.test_from_import_asc             C   sn   |  j  |  j d d ƒ ƒ |  j  |  j d d ƒ ƒ |  j |  j d d d ƒ ƒ |  j |  j d d d ƒ ƒ d  S)Nr-   zimport bzimport b, c, drG   )r%   rE   r'   )r   r   r   r   Útest_simple_import_with_package×   s    z1Test_find_binding.test_simple_import_with_packagec             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,   zfrom x import arT   zfrom a import azfrom x import *zfrom x import b, c, a, dzfrom x.b import azx.bzfrom x.b import *zfrom x.b import b, c, a, dzfrom a import bzfrom a.d import bza.dzfrom d.a import bzfrom x.y import *za.b)r%   rE   r'   )r   r   r   r   Útest_from_import_with_packageÝ   s    z/Test_find_binding.test_from_import_with_packagec             C   sX   |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ |  j  |  j d d d ƒ ƒ d  S)Nr,   zimport b.c as azb.czimport a as fÚf)r'   rE   )r   r   r   r   Útest_import_as_with_packageê   s    z-Test_find_binding.test_import_as_with_packagec             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,   zfrom x import b as arT   zfrom x import g as a, d as bzfrom x.b import t as azx.bzfrom x.b import g as a, dzfrom a import b as tr-   Út)r'   rE   )r   r   r   r   Ú test_from_import_as_with_packageï   s    z2Test_find_binding.test_from_import_as_with_packagec             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,   zdef a(): passzdef a(b, c, d): passzdef a(): b = 7zdef d(b, (c, a), e): passzdef d(a=7): passzdef d(a): passzdef d(): a = 7zG
            def d():
                def a():
                    pass)r%   rE   r'   )r   Úsr   r   r   Útest_function_defû   s    z#Test_find_binding.test_function_defc             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,   zclass a: passzclass a(): passzclass a(b): passzclass a(b, c=8): passzclass d: passzclass d(a): passzclass d(b, a=7): passzclass d(b, *a): passzclass d(b, **a): passzclass d: a = 7zK
            class d():
                class a():
                    pass)r%   rE   r'   )r   r{   r   r   r   Útest_class_def
  s    z Test_find_binding.test_class_defc             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,   zfor a in r: passzfor a, b in r: passzfor (a, b) in r: passzfor c, (a,) in r: passzfor c, (a, b) in r: passzfor c in r: a = czfor c in a: pass)r%   rE   r'   )r   r   r   r   Útest_for  s    zTest_find_binding.test_forc             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)
NzM
            for b in r:
                for a in b:
                    passr,   zP
            for b in r:
                for a, c in b:
                    passzR
            for b in r:
                for (a, c) in b:
                    passzP
            for b in r:
                for (a,) in b:
                    passzU
            for b in r:
                for c, (a, d) in b:
                    passzN
            for b in r:
                for c in b:
                    a = 7zN
            for b in r:
                for c in b:
                    d = azN
            for b in r:
                for c in a:
                    d = 7)r%   rE   r'   )r   r{   r   r   r   Útest_for_nested%  s     z!Test_find_binding.test_for_nestedc             C   s6   |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S)Nr,   zif b in r: a = czif a in r: d = e)r%   rE   r'   )r   r   r   r   Útest_ifV  s    zTest_find_binding.test_ifc             C   sB   d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d  S)NzL
            if b in r:
                if c in d:
                    a = cr,   zL
            if b in r:
                if c in d:
                    c = a)r%   rE   r'   )r   r{   r   r   r   Útest_if_nestedZ  s    z Test_find_binding.test_if_nestedc             C   s6   |  j  |  j d d ƒ ƒ |  j |  j d d ƒ ƒ d  S)Nr,   zwhile b in r: a = czwhile a in r: d = e)r%   rE   r'   )r   r   r   r   Ú
test_whileg  s    zTest_find_binding.test_whilec             C   sB   d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d  S)NzR
            while b in r:
                while c in d:
                    a = cr,   zR
            while b in r:
                while c in d:
                    c = a)r%   rE   r'   )r   r{   r   r   r   Útest_while_nestedk  s    z#Test_find_binding.test_while_nestedc             C   s€   d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d  S)NzQ
            try:
                a = 6
            except:
                b = 8r,   zQ
            try:
                b = 8
            except:
                a = 6zƒ
            try:
                b = 8
            except KeyError:
                pass
            except:
                a = 6zQ
            try:
                b = 8
            except:
                b = 6)r%   rE   r'   )r   r{   r   r   r   Útest_try_exceptx  s    z!Test_find_binding.test_try_exceptc             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)	Nz›
            try:
                try:
                    a = 6
                except:
                    pass
            except:
                b = 8r,   z›
            try:
                b = 8
            except:
                try:
                    a = 6
                except:
                    passz›
            try:
                b = 8
            except:
                try:
                    pass
                except:
                    a = 6zÕ
            try:
                try:
                    b = 8
                except KeyError:
                    pass
                except:
                    a = 6
            except:
                passzÕ
            try:
                pass
            except:
                try:
                    b = 8
                except KeyError:
                    pass
                except:
                    a = 6zQ
            try:
                b = 8
            except:
                b = 6a  
            try:
                try:
                    b = 8
                except:
                    c = d
            except:
                try:
                    b = 6
                except:
                    t = 8
                except:
                    o = y)r%   rE   r'   )r   r{   r   r   r   Útest_try_except_nested—  s    		z(Test_find_binding.test_try_except_nestedc             C   s€   d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d  S)Nz|
            try:
                c = 6
            except:
                b = 8
            finally:
                a = 9r,   zR
            try:
                b = 8
            finally:
                a = 6zR
            try:
                b = 8
            finally:
                b = 6z|
            try:
                b = 8
            except:
                b = 9
            finally:
                b = 6)r%   rE   r'   )r   r{   r   r   r   Útest_try_except_finallyä  s    z)Test_find_binding.test_try_except_finallyc             C   sa   d } |  j  |  j d | ƒ ƒ d } |  j  |  j d | ƒ ƒ d } |  j |  j d | ƒ ƒ d  S)Nzú
            try:
                c = 6
            except:
                b = 8
            finally:
                try:
                    a = 9
                except:
                    b = 9
                finally:
                    c = 9r,   z
            try:
                b = 8
            finally:
                try:
                    pass
                finally:
                    a = 6zž
            try:
                b = 8
            finally:
                try:
                    b = 6
                finally:
                    b = 7)r%   rE   r'   )r   r{   r   r   r   Útest_try_except_finally_nested  s    		z0Test_find_binding.test_try_except_finally_nested)r   r    r!   rE   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rx   rz   r|   r}   r~   r   r€   r   r‚   rƒ   r„   r…   r†   r‡   r   r   r   r   rl   –   s2   
		1M!rl   c               @   sL   e  Z d  Z d d „  Z d d „  Z d d „  Z d d „  Z d	 d
 „  Z d S)ÚTest_touch_importc             C   s9   t  d ƒ } t j d  d | ƒ |  j t | ƒ d ƒ d  S)Nz"""foo"""
bar()Úfooz"""foo"""
import foo
bar()

)r   r   Útouch_importr   r   )r   r   r   r   r   Útest_after_docstring*  s    z&Test_touch_import.test_after_docstringc             C   s9   t  d ƒ } t j d  d | ƒ |  j t | ƒ d ƒ d  S)Nz"""foo"""
import bar
bar()r‰   z'"""foo"""
import bar
import foo
bar()

)r   r   rŠ   r   r   )r   r   r   r   r   Útest_after_imports/  s    z$Test_touch_import.test_after_importsc             C   s9   t  d ƒ } t j d  d | ƒ |  j t | ƒ d ƒ d  S)Nzbar()r‰   zimport foo
bar()

)r   r   rŠ   r   r   )r   r   r   r   r   Útest_beginning4  s    z Test_touch_import.test_beginningc             C   s9   t  d ƒ } t j d d | ƒ |  j t | ƒ d ƒ d  S)Nzbar()ZhtmlÚescapezfrom html import escape
bar()

)r   r   rŠ   r   r   )r   r   r   r   r   rr   9  s    z"Test_touch_import.test_from_importc             C   s9   t  d ƒ } t j d  d | ƒ |  j t | ƒ d ƒ d  S)Nzbar()Zcgizimport cgi
bar()

)r   r   rŠ   r   r   )r   r   r   r   r   Útest_name_import>  s    z"Test_touch_import.test_name_importN)r   r    r!   r‹   rŒ   r   rr   r   r   r   r   r   rˆ   (  s
   rˆ   c               @   s(   e  Z d  Z d d „  Z d d „  Z d S)ÚTest_find_indentationc             C   sQ   t  j } t d ƒ } |  j | | ƒ d ƒ t d ƒ } |  j | | ƒ d ƒ d  S)Nznode()Ú )r   Úfind_indentationr   r   )r   Úfir   r   r   r   Útest_nothingE  s
    	z"Test_find_indentation.test_nothingc             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)Nzdef f():
    x()r‘   r   r=   r#   z    zdef f():
    x()
    y())r   r’   r   r   r   )r   r“   r   r   r   r   Útest_simpleL  s    	+z!Test_find_indentation.test_simpleN)r   r    r!   r”   r•   r   r   r   r   r   C  s   r   )Ú__doc__r‘   r   Zos.pathÚosZlib2to3.pytreer   r   Zlib2to3r   Zlib2to3.fixer_utilr   r   r	   r
   Zlib2to3.pgen2r   r   ZTestCaser   r"   r)   r+   r3   r5   rD   rl   rˆ   r   r   r   r   r   Ú<module>   s$   "	,ÿ “