
    Xh                        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j                         dk(  Z	 e j                  d      j                         Zej                  dd dk(  Zej                  j!                  e	d      ej                  j#                  d	dej%                         gg      d
               Zej                  j!                  e	d      ej                  j#                  dddgddgddgddgddgg      d               Zej                  j!                  e	d      ej                  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               Zej                  j!                  e	 d      ej                  j#                  dddgddgddgg      d               Zej                  j!                  ed      ej                  j!                  e	d      ej                  j#                  d	 eed z        ed z  j%                         gg      d!                      Zej                  j!                  e	 d      ej                  j#                  d	dd"gd#d"gd$d%gg      d&               Zej                  j!                  e	d      ej                  j#                  d'd(d)gd*d+gd,d-gg      d.               Zej                  j!                  e	 d      ej                  j#                  d/d(d0gd*d1gg      d2               Zy)3    N   )file_uri_to_pathis_relativenormalized_uriWindows~)      z!can't test POSIX paths on Windows)reasonzroot_dir, expected_root_uric                 $    t        |       |k(  sJ y Nr   root_direxpected_root_uris     P/var/www/html/myenv/lib/python3.12/site-packages/jupyter_lsp/tests/test_paths.pytest_normalize_posix_path_homer      s     (#'8888    z
root, pathz~/az	~/a/../b//z/az/a/bz	/a/b/../cc                      t        | |      sJ y r   r   rootpaths     r   test_is_relative_okr      s     tT"""r   z~/..z/a/b/..z/a/../bza//c                      t        | |      rJ y r   r   r   s     r   test_is_relative_not_okr      s     4&&&&r   z!can't test Windows paths on POSIXzc:\Users\user1z	c:\Users\zd:\zc:\Userszc:\Users\..c                      t        | |      rJ y r   r   r   s     r   test_is_relative_not_ok_winr   .   s     4&&&&r   z%can't test non-existent paths on py35fooc                 $    t        |       |k(  sJ y r   r   r   s     r   %test_normalize_posix_path_home_subdirr"   ;   s     (#'8888r   zfile:///c:/Users/user1zC:\Users\user1//VBOXSVR/shared-folderzfile://vboxsvr/shared-folder/c                     	 t        |       }||k(  sJ y # t        $ r$}t        j                  dk  r
| dk(  rY d }~y |d }~ww xY w)N)r	      r#   )r   FileNotFoundErrorsysversion_info)r   r   
normalizederrs       r    test_normalize_windows_path_caser+   J   sR    #H-
 ****  g%(6O*O		s    	A==A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                 $    t        |       |k(  sJ y r   r   )file_uriexpected_posix_paths     r   test_file_uri_to_path_posixr0   _   s     H%)<<<<r   zfile_uri, expected_windows_pathzC:/Windows/System32/Drivers/etczC:/some dir/some file.txtc                 $    t        |       |k(  sJ y r   r-   )r.   expected_windows_paths     r   test_file_uri_to_path_windowsr3   l   s     H%)>>>>r   )pathlibplatformr'   pytestpathsr   r   r   systemWINPath
expanduserHOMEr(   PY35markskipifparametrizeas_urir   r   r   r   strr"   r+   r0   r3    r   r   <module>rD      s     
  A Ahoo9$w||C##%
v% C CD6#t{{}9M8NO9 P E9 C CD	5\C%SzD&>D+CVW#	 E
# C CD	f	c
	s			y	u' E' G$GH	]+	V$	o&' I' D!HIC CD! 
TE\	TE\11349 E J9 G$GH!	56	56	"$CD	+ I	+ C CD#	24VW	02NO	,.HI= E= G$GH% 
34UV	02MN? I?r   