
    ,hi                     P    d Z ddlZddlZddlmZ ddlmZ ddlmZ  G d d      Z	y)	zinstall_scripts tests    N)install_scripts)Distribution   )contextsc                      e Zd Z edddgid      ZdZdZdZdd
Ze	j                  j                  ej                  dk(  d      d        Ze	j                  j                  ej                  dk7  d      d        Ze	j                  j                  ej                  dk(  d      d        Ze	j                  j                  ej                  dk7  d      d        Zy	)TestInstallScriptsfooconsole_scriptszfoo=foo:fooz0.0)nameentry_pointsversionz%/usr/dummy-test-path/local/bin/pythonz/usr/bin/env dummy-test-pythonz6C:\Dummy Test Path\Program Files\Python 3.6\python.exeNc                 &   t        | j                        }d|_        t        |      }||_        ||j                  d      }||_        |j                          t        j                         5  |j                          d d d        y # 1 sw Y   y xY w)Nzsetup.pybuild_scripts)r   settingsscript_namer   install_dirget_finalized_command
executableensure_finalizedr   quietrun)selfr   r   distcmdbss         g/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/setuptools/tests/test_install_scripts.py_run_install_scriptsz'TestInstallScripts._run_install_scripts   sz    DMM*%d#%!**?;B&BM^^ 	GGI	 	 	s   -BBwin32znon-Windows only)reasonc                 ~   d| j                    d}|j                  d| j                          |j                         5  | j                  t	        |             t        t	        |j                  d            dd      5 }|j                         }ddd       ddd       |k(  sJ y# 1 sw Y   xY w# 1 sw Y   xY w)	zt
        Ensure that shebang is not quoted on Unix when getting the Python exe
        from sys.executable.
        #!
sys.executabler	   rutf-8encodingN)unix_exesetattras_cwdr   stropenjoinreadliner   tmpdirmonkeypatchexpectedfactuals         r   !test_sys_executable_escaping_unixz4TestInstallScripts.test_sys_executable_escaping_unix#   s     b),dmm<]]_ 	&%%c&k2c&++e,-sWE &&	& !!!& &	& 	&$   AB3>B'B3'B0	,B33B<zWindows onlyc                 ~   d| j                    d}|j                  d| j                          |j                         5  | j                  t	        |             t        t	        |j                  d            dd      5 }|j                         }ddd       ddd       |k(  sJ y# 1 sw Y   xY w# 1 sw Y   xY w)	z
        Ensure that shebang is quoted on Windows when getting the Python exe
        from sys.executable and it contains a space.
        #!""
r#   foo-script.pyr$   r%   r&   N)	win32_exer)   r*   r   r+   r,   r-   r.   r/   s         r   "test_sys_executable_escaping_win32z5TestInstallScripts.test_sys_executable_escaping_win321   s     (,,dnn=]]_ 	&%%c&k2c&++o67wO &ST&	& !!!& &	& 	&r6   c                 \   d| j                    d}|j                         5  | j                  t        |      | j                          t	        t        |j                  d            dd      5 }|j                         }ddd       ddd       |k(  sJ y# 1 sw Y   xY w# 1 sw Y   xY w)z
        Ensure that shebang on Unix is not quoted, even when
        a value with spaces
        is specified using --executable.
        r!   r"   r	   r$   r%   r&   N)unix_spaces_exer*   r   r+   r,   r-   r.   r   r0   r2   r3   r4   s        r   )test_executable_with_spaces_escaping_unixz<TestInstallScripts.test_executable_with_spaces_escaping_unix?   s     ,,-R0]]_ 	&%%c&k43G3GHc&++e,-sWE &&	& !!!& &	& 	&s$   AB"-B>B"B	B""B+c                 h   d| j                    d}|j                         5  | j                  t        |      d| j                   z   dz          t	        t        |j                  d            dd      5 }|j                         }ddd       ddd       |k(  sJ y# 1 sw Y   xY w# 1 sw Y   xY w)	z
        Ensure that shebang on Windows is quoted when
        getting a path with spaces
        from --executable, that is itself properly quoted.
        r8   r9   "r:   r$   r%   r&   N)r;   r*   r   r+   r,   r-   r.   r?   s        r   "test_executable_arg_escaping_win32z5TestInstallScripts.test_executable_arg_escaping_win32M   s     (,]]_ 	&%%c&k33G#3MNc&++o67wO &ST&	& !!!& &	& 	&s$   AB(3BB(B%	!B((B1)N)__name__
__module____qualname__dictr   r(   r>   r;   r   pytestmarkskipifsysplatformr5   r<   r@   rC        r   r   r      s    '-9H
 7H6OLI
 [[/8JK" L" [[/G" H" [[/8JK" L" [[/G" H"rN   r   )
__doc__rK   rH   "setuptools.command.install_scriptsr   setuptools.distr    r   r   rM   rN   r   <module>rS      s#     
  > ( L" L"rN   