o
    ^i                     @   sT  d dl Z d dlZd dlZd dlZddlmZmZmZ e dkZ	e 
d Zejdd dkZejje	ddejd	de ggd
d Zejje	ddejdddgddgddgddgddggdd Zejje	ddejdddgddgddgddgddgddgddggdd Zejje	 ddejdddgddgdd ggd!d" Zejjed#dejje	ddejd	eed$ ed$  ggd%d& Zejje	 ddejd	dd'gd(d'gd)d*ggd+d, Zejje	ddejd-d.d/gd0d1gd2d3ggd4d5 Zejje	 ddejd6d.d7gd0d8ggd9d: ZdS );    N   )file_uri_to_pathis_relativenormalized_uriWindows~)      z!can't test POSIX paths on Windows)reasonzroot_dir, expected_root_uric                 C      t | |ksJ d S Nr   root_direxpected_root_uri r   W/home/ubuntu/hpml_nyu/venv/lib/python3.10/site-packages/jupyter_lsp/tests/test_paths.pytest_normalize_posix_path_home   s   r   z
root, pathz~/az	~/a/../b//z/az/a/bz	/a/b/../cc                 C   s   t | |sJ d S r   r   rootpathr   r   r   test_is_relative_ok   s   r   z~/..z/a/b/..z/a/../bza//c                 C      t | |rJ d S r   r   r   r   r   r   test_is_relative_not_ok   s   r   z!can't test Windows paths on POSIXzc:\Users\user1z	c:\Users\zd:\zc:\Userszc:\Users\..c                 C   r   r   r   r   r   r   r   test_is_relative_not_ok_win.   s   
r   z%can't test non-existent paths on py35fooc                 C   r   r   r   r   r   r   r   %test_normalize_posix_path_home_subdir;   s   r   zfile:///c:/Users/user1zC:\Users\user1//VBOXSVR/shared-folderzfile://vboxsvr/shared-folder/c              
   C   sZ   zt | }W n ty$ } ztjdk r| dkrW Y d }~d S |d }~ww ||ks+J d S )N)r      r   )r   FileNotFoundErrorsysversion_info)r   r   
normalizederrr   r   r    test_normalize_windows_path_caseJ   s   
r&   zfile_uri, expected_posix_pathz'file:///C:/Windows/System32/Drivers/etcz /C:/Windows/System32/Drivers/etcz%file:///C:/some%20dir/some%20file.txtz/C:/some dir/some file.txtz!file:///home/user/some%20file.txtz/home/user/some file.txtc                 C   r   r   r   )file_uriexpected_posix_pathr   r   r   test_file_uri_to_path_posix_      
r*   zfile_uri, expected_windows_pathzC:/Windows/System32/Drivers/etczC:/some dir/some file.txtc                 C   r   r   r'   )r(   expected_windows_pathr   r   r   test_file_uri_to_path_windowsl   r+   r-   )pathlibplatformr"   pytestpathsr   r   r   systemWINPath
expanduserHOMEr#   PY35markskipifparametrizeas_urir   r   r   r   strr   r&   r*   r-   r   r   r   r   <module>   s     