o
    û›hÅ  ã                   @   sl   d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlm	Z
 e
jdd„ ƒZe
jd	d
„ ƒZdd„ ZdS )z"Tests for IPython.core.applicationé    N)ÚTemporaryDirectory)ÚUnicode)ÚBaseIPythonApplication)Ú
decoratorsc               	   C   s^   t jdd�} t ¡ }t | ¡ ztƒ }| ¡  | ¡  |jdd� W t |¡ dS t |¡ w )z@Check that IPython starts with non-ascii characters in the path.õ   â‚¬©ÚsuffixF©Zsuppress_errorsN)	ÚtempfileÚmkdtempÚosÚgetcwdÚchdirr   Úinit_profile_dirÚinit_config_filesÚload_config_file)ÚwdZold_wdÚapp© r   úYc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/core/tests/test_application.pyÚtest_unicode_cwd   s   
r   c               	   C   sÒ   t jdd�} ttj | d¡ddd��}W d  ƒ n1 sw   Y  tj dd¡}tj d	d¡}| tjd< z$tƒ }| 	¡  | 
¡  |jd
d� W |rO|tjd< |rX|tjd< dS dS |ra|tjd< |rh|tjd< w )zBCheck that IPython starts with non-ascii characters in the IP dir.r   r   úipython_config.pyÚwúutf-8©ÚencodingNZ
IPYTHONDIRZIPYTHON_DIRFr	   )r
   r   Úopenr   ÚpathÚjoinÚenvironÚpopr   r   r   r   )ZipdirÚfZ
old_ipdir1Z
old_ipdir2r   r   r   r   Útest_unicode_ipdir   s*   ÿ

ÿþ
r"   c               	   C   sÄ   t ƒ �U} G dd„ dtƒ}ttj | d¡ddd��}| d¡ W d   ƒ n1 s(w   Y  |ƒ }| d| g¡ |jd	ks>J ‚|ƒ }| d| d
g¡ |jdksPJ ‚W d   ƒ d S 1 s[w   Y  d S )Nc                   @   s   e Zd Zeƒ jdd�ZdS )z"test_cli_priority.<locals>.TestAppT)ÚconfigN)Ú__name__Ú
__module__Ú__qualname__r   ÚtagÚtestr   r   r   r   ÚTestApp:   s    r)   r   r   r   r   zc.TestApp.test = 'config file'z--profile-dirzconfig filez--TestApp.test=cliÚcli)	r   r   r   r   r   r   ÚwriteZ
initializer(   )Útdr)   r!   r   r   r   r   Útest_cli_priority7   s   ÿ"òr-   )Ú__doc__r   r
   r   Z	traitletsr   ZIPython.core.applicationr   ZIPython.testingr   ÚdecZonlyif_unicode_pathsr   r"   r-   r   r   r   r   Ú<module>   s   

