
    }e                     t    d Z ddlmZ ddlmZ g ZdZ G d de      Z	 G d dej                        Zd Zd	 Zy
)zTests for input handlers.
    )autocall)toolsc                       e Zd Zd Zd Zy)CallableIndexablec                      yNT )selfidxs     B/usr/lib/python3/dist-packages/IPython/core/tests/test_handlers.py__getitem__zCallableIndexable.__getitem__   s    t    c                      yr   r	   )r
   argskwss      r   __call__zCallableIndexable.__call__   s    Tr   N)__name__
__module____qualname__r   r   r	   r   r   r   r      s    +1r   r   c                       e Zd Zd Zy)Autocallablec                      y)Ncalledr	   )r
   s    r   r   zAutocallable.__call__   s    r   N)r   r   r   r   r	   r   r   r   r      s    r   r   c                 `    t        j                  t        j                  j                  |        y)zLoop through a list of (pre, post) inputs, where pre is the string
    handed to ipython, and post is how that string looks after it's been
    transformed (i.e. ipython's notion of _i)N)ttcheck_pairsipprefilter_managerprefilter_lines)testss    r   runr!   "   s     NN2''77?r   c                     t               } | t        j                  d<   t        ddg       t	               }|t        j                  d<   t        j                  dd       t        g d       t        j                  dd       t        g d	       t        j                  dd
       t        g d       t        j                  dd       t        g k(  sJ y )Ncall_idx)"no change"r$   )lsmagicz+get_ipython().run_line_magic('lsmagic', '')autocallabler   0))	len "abc"r(   )r&   autocallable())r)   r)   1)r(   z
len("abc")z
len "abc";zlen("abc");z	len [1,2]z
len([1,2])call_idx [1]r/   z
call_idx 1zcall_idx(1))lenr1   2)r+   r,   r-   r.   r0   )r1   zlen())r   r   user_nsr!   r   run_line_magicfailures)r#   r&   s     r   test_handlersr6   )   s     "H%BJJz
 	'	H	  >L!-BJJ~ j#& 	
 j#&		
 j#&	

 j#&r>>r   N)__doc__IPython.corer   IPython.testingr   r   r5   	num_testsobjectr   IPyAutocallr   r!   r6   r	   r   r   <module>r=      sG    " ' 	2 2
8'' 
@8r   