
    ^h                         S r SSKrSSKrSSKrSSKJr  SSKJs  Jr	  \" \
5      R                  5       R                  r\" \R                  " SS95      r\R                   rS rS rS rS	 rS
 rS rS rS rS rg)z'Tests for IPython.utils.module_paths.py    N)Pathzwith.dot)suffixc                 6    [        U SSS9R                  5         g )Nwzutf-8)encoding)openclose)fnames    _/home/james-whalen/.local/lib/python3.13/site-packages/IPython/utils/tests/test_module_paths.pymake_empty_filer       s    g&,,.    c                  B   [        [        S-  5      R                  SS9  [        [        S-  5      R                  SS9  [        [        S-  5        [        [        S-  5        [        [        S-  5        [        [        S-  5        [	        [        5      /[
        l        g	)
z+Setup testenvironment for the module:

    xmodT)parentsnomodzxmod/__init__.pyzxmod/sub.pypack.pyzpackpyc.pycN)r   TMP_TEST_DIRmkdirr   strsyspath r   r   setup_moduler   $   s~     		%%d%3	 &&t&4L#556L=01L9,-L=01L!"CHr   c                  V    [         R                  " [        5        [        [        l        g)zNTeardown testenvironment for the module:

- Remove tempdir
- restore sys.path
N)shutilrmtreer   old_syspathr   r   r   r   r   teardown_moduler   2   s     MM,CHr   c                  .    S[        [        5      ;   d   eg)zK
Ensure the test are done with a temporary file that have a dot somewhere.
.N)r   r   r   r   r   test_tempdirr!   >   s     #l####r   c                  f    [         S-  S-  n [        [        R                  " S5      5      U :X  d   eg)zc
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modpaths    r   test_find_mod_1r)   E   s/    
 V#m3GF#$///r   c                  f    [         S-  S-  n [        [        R                  " S5      5      U :X  d   eg)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'   s    r   test_find_mod_2r+   M   s/     V#m3GF#$///r   c                  f    [         S-  S-  n [        [        R                  " S5      5      U :X  d   eg)zn
Search for a directory + a filename without its .py extension
Expected output: full path with .py extension.
r   zsub.pyzxmod.subNr$   r'   s    r   test_find_mod_3r-   V   s/    
 V#h.GJ'(G333r   c                  `    [         S-  n [        [        R                  " S5      5      U :X  d   eg)z_
Search for a filename without its .py extension
Expected output: full path with .py extension
r   packNr$   r'   s    r   test_find_mod_4r0   ^   s*    
 Y&GF#$///r   c                  <    [         R                  " S5      S:X  d   eg)zi
Search for a filename with a .pyc extension
Expected output: TODO: do we exclude or include .pyc files?
packpycN)r%   r&   r   r   r   test_find_mod_5r3   f   s    
 ;;y!T)))r   )__doc__r   r   tempfilepathlibr   IPython.utils.module_pathsutilsmodule_pathsr%   __file__resolveparentTEST_FILE_PATHmkdtempr   r   r   r   r   r   r!   r)   r+   r-   r0   r3   r   r   r   <module>r?      s    -  
   ' 'h'')00H$$J78
 hh/#
$0040*r   