o
    Zht                     @   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   Y/var/www/html/lang_env/lib/python3.10/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-lZ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    