o
    û›ht  ã                   @   s<   d Z ddlZddlmZ ddlmZ ddlmZ dd„ ZdS )zTest installing editor hooksé    N)Úmock)Úget_ipython)Úeditorhooksc                     sÄ   g ‰ ‡ fdd„} t jddd� t d| ¡� tƒ j dd¡ W d   ƒ n1 s(w   Y  tˆ ƒd	ks5J ‚ˆ d
 d }ˆ d
 d }|ddiksIJ ‚tj	 
d¡rTg d¢}nd}|d
 }||ks`J ‚d S )Nc                     s$   ˆ   | |dœ¡ tjdi ddi¤ŽS )N©ÚargsÚkwargszwait.return_valuer   © )Úappendr   Z	MagicMockr   ©Úcalledr   úXc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/lib/tests/test_editorhooks.pyÚ
fake_popen
   s
   þz'test_install_editor.<locals>.fake_popenzfoo -l {line} -f {filename}F)Úwaitzsubprocess.Popenúthe fileé@   é   r   r   r   ÚshellTÚwin)Zfooz-lÚ64z-fr   zfoo -l 64 -f 'the file')r   Zinstall_editorr   Úpatchr   ÚhooksZeditorÚlenÚsysÚplatformÚ
startswith)r   r   r   ÚexpectedÚcmdr   r
   r   Útest_install_editor   s   ÿ
r   )	Ú__doc__r   Zunittestr   ZIPythonr   ZIPython.libr   r   r   r   r   r   Ú<module>   s    