o
    û›hÈ  ã                   @   sª   d Z ddlZddlZddlZddlmZ ddlm  mZ	 ee
ƒ ¡ jZeejdd�ƒZejZdd„ Zdd	„ Zd
d„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )z'Tests for IPython.utils.module_paths.pyé    N)ÚPathzwith.dot)Úsuffixc                 C   s   t | ddd� ¡  d S )NÚwzutf-8)Úencoding)ÚopenÚclose)Úfname© r	   ú[c:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/utils/tests/test_module_paths.pyÚmake_empty_file    s   r   c                   C   sh   t td ƒjdd� t td ƒjdd� ttd ƒ ttd ƒ ttd ƒ ttd ƒ ttƒgt_d	S )
z+Setup testenvironment for the module:

    ÚxmodT)ÚparentsZnomodzxmod/__init__.pyzxmod/sub.pyúpack.pyzpackpyc.pycN)r   ÚTMP_TEST_DIRÚmkdirr   ÚstrÚsysÚpathr	   r	   r	   r
   Úsetup_module$   s   r   c                   C   s   t  t¡ tt_dS )zZTeardown testenvironment for the module:

    - Remove tempdir
    - restore sys.path
    N)ÚshutilÚrmtreer   Úold_syspathr   r   r	   r	   r	   r
   Úteardown_module2   s   
	
r   c                   C   s   dt tƒv sJ ‚dS )zS
    Ensure the test are done with a temporary file that have a dot somewhere.
    Ú.N)r   r   r	   r	   r	   r
   Útest_tempdir>   s   r   c                  C   ó&   t d d } tt d¡ƒ| ksJ ‚dS )zo
    Search for a directory's file path.
    Expected output: a path to that directory's __init__.py file.
    r   ú__init__.pyN©r   r   ÚmpÚfind_mod©Úmodpathr	   r	   r
   Útest_find_mod_1E   ó   r"   c                  C   r   )zŸ
    Search for a directory's file path.
    Expected output: a path to that directory's __init__.py file.
    TODO: Confirm why this is a duplicate test.
    r   r   Nr   r    r	   r	   r
   Útest_find_mod_2M   s   r$   c                  C   s&   t d d } tt d¡ƒ| ksJ ‚dS )zz
    Search for a directory + a filename without its .py extension
    Expected output: full path with .py extension.
    r   zsub.pyzxmod.subNr   r    r	   r	   r
   Útest_find_mod_3V   r#   r%   c                  C   s"   t d } tt d¡ƒ| ksJ ‚dS )zk
    Search for a filename without its .py extension
    Expected output: full path with .py extension
    r   ÚpackNr   r    r	   r	   r
   Útest_find_mod_4^   s   r'   c                   C   s   t  d¡dks	J ‚dS )zu
    Search for a filename with a .pyc extension
    Expected output: TODO: do we exclude or include .pyc files?
    ZpackpycN)r   r   r	   r	   r	   r
   Útest_find_mod_5f   s   r(   )Ú__doc__r   r   ÚtempfileÚpathlibr   ZIPython.utils.module_pathsÚutilsZmodule_pathsr   Ú__file__ÚresolveÚparentZTEST_FILE_PATHÚmkdtempr   r   r   r   r   r   r   r"   r$   r%   r'   r(   r	   r	   r	   r
   Ú<module>   s$   	