
    ft                     :    d Z ddlZddlmZ ddlmZ ddlmZ d Zy)zTest installing editor hooks    N)mock)get_ipython)editorhooksc                     g fd} t        j                  dd       t        j                  d|       5  t	               j
                  j                  dd       d d d        t              dk(  sJ d	   d
   }d	   d   }|ddik(  sJ t        j                  j                  d      rg d}nd}|d	   }||k(  sJ y # 1 sw Y   exY w)Nc                  Z    j                  | |d       t        j                  di ddiS )N)argskwargszwait.return_valuer    )appendr   	MagicMock)r   r	   calleds     ]/var/www/cvtools/html/venv/lib/python3.12/site-packages/IPython/lib/tests/test_editorhooks.py
fake_popenz'test_install_editor.<locals>.fake_popen
   s4    
 	 ~~9!4a 899    z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   s        @r   test_install_editorr#      s    F: <5I	&
	3 3"":r23 v;!!9VDAYx Fgt_$$$
||u%8,
q'C(??3 3s   %B??C)	__doc__r   unittestr   IPythonr   IPython.libr   r#   r
   r   r   <module>r(      s    " 
   #r   