o
    û›hd  ã                   @   s>   d Z ddlZddlmZ ddlmZ G dd„ dejejƒZ	dS )z>Tests for shellapp module.

Authors
-------
* Bradley Froehle
é    N)Ú
decorators)Útoolsc                   @   s.   e Zd ZdZdd„ Zdd„ Zejdd„ ƒZdS )	ÚTestFileToRunz/Test the behavior of the file_to_run parameter.c                 C   s(   d}|   |¡ d}t | j| j|¡ dS )z:Test that `__file__` is set when running `ipython file.py`úprint(__file__)
N©ÚmktmpÚttZipexec_validateÚfname©ÚselfÚsrcÚerr© r   úVc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/core/tests/test_shellapp.pyÚtest_py_script_file_attribute   s   
z+TestFileToRun.test_py_script_file_attributec                 C   s,   d}| j |dd� d}t | j| j|¡ dS )z;Test that `__file__` is set when running `ipython file.ipy`r   z.ipy)ÚextNr   r
   r   r   r   Útest_ipy_script_file_attribute#   s   z,TestFileToRun.test_ipy_script_file_attributec                 C   sF   d}|   |¡ tj| jdgg d¢d�\}}d|v s!J d|› d�ƒ‚dS )	z:Test that `__file__` is not set after `ipython -i file.py`zTrue
z-i)z"__file__" in globals()z
print(123)zexit())ÚoptionsÚcommandsÚFalsezSubprocess stderr:
z
-----N)r   r   Zipexecr	   )r   r   Úoutr   r   r   r   Ú+test_py_script_file_attribute_interactively-   s   

ýz9TestFileToRun.test_py_script_file_attribute_interactivelyN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚdecZ
skip_win32r   r   r   r   r   r      s    
r   )
r   ZunittestZIPython.testingr   r   r   r   ZTempFileMixinZTestCaser   r   r   r   r   Ú<module>   s
   