o
    Ďit                     @   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   	MagicMockr   calledr   ^/home/jeff/fluffinator/venv/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)fooz-l64z-fr   zfoo -l 64 -f 'the file')r   install_editorr   patchr   hookseditorlensysplatform
startswith)r   r   r   expectedcmdr   r   r   test_install_editor   s   
r!   )	__doc__r   unittestr   IPythonr   IPython.libr   r!   r   r   r   r   <module>   s    