
    ,h                         d Z ddlZddlZddlZddlmZ ddlmZ ddlm	Z	m
Z
 ddlmZ ddlZddlZddlmZ ddlmZ  G d	 d
ej(                        Zy)zTests for distutils.spawn.    N)DistutilsExecError)find_executablespawn)support)
unix_shell   )py39c                   j    e Zd Zej                  j                  d      d        Zd Zed        Z	d Z
y)	TestSpawnzos.name not in ('nt', 'posix')c                    | j                         }t        j                  dk7  r;t        j                  j                  |d      }| j                  |dt         d       n2t        j                  j                  |d      }| j                  |d       t        j                  |d       t        j                  t              5  t        |g       d d d        t        j                  dk7  r;t        j                  j                  |d      }| j                  |dt         d       n2t        j                  j                  |d      }| j                  |d	       t        j                  |d       t        |g       y # 1 sw Y   xY w)
Nwin32zfoo.shz#!z
exit 1zfoo.batzexit 1i  z
exit 0zexit 0)mkdtempsysplatformospathjoin
write_filer   chmodpytestraisesr   r   )selftmpdirexes      h/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_spawn.py
test_spawnzTestSpawn.test_spawn   s    <<7"'',,vx0COOC2j\!:;'',,vy1COOC*
e]]-. 	3%L	 <<7"'',,vx0COOC2j\!:;'',,vy1COOC*
ese	 	s    E88Fc           	          | j                  |d      }|j                  }|j                  d      j                  }t        |      }t	        j
                  |      }t        ||      }||k(  sJ t        j                  dk(  rt        ||      }||k(  sJ |5  t        |      }||k(  sJ 	 d d d        d|z   }t        ||      }|J t        j                         5 }	d|	d<   t        j                  d|d	      5  t        j                  d
|      5  t        |      }|J |5  t        |      }||k(  sJ 	 d d d        d d d        d d d        d d d        t        j                         5 }	t        j                  |	d<   t        j                  ddd	      5  t        j                  d
d      5  t        |      }|J |5  t        |      }||k(  sJ 	 d d d        d d d        d d d        d d d        t        j                         5 }	|	j                  dd        t        j                  dt         d      5  t        j                  d
|      5  t        |      }||k(  sJ 	 d d d        d d d        t        j                  d|d	      5  t        j                  d
d      5  t        |      }||k(  sJ 	 d d d        d d d        d d d        y # 1 sw Y   &xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   =xY w# 1 sw Y   BxY w# 1 sw Y   GxY w# 1 sw Y   LxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nz.exe )r   r   
dontexist_PATHzdistutils.spawn.os.confstrT)return_valuecreatezdistutils.spawn.os.defpath)side_effectr"   )_make_executablenamewith_suffixstrr   Pathr   r   r   	os_helperEnvironmentVarGuardmockpatchr   pathseppop
ValueError)
r   tmp_pathprogram_pathprogramprogram_noeextfilenametmp_dirrvdont_exist_programenvs
             r   test_find_executablezTestSpawn.test_find_executable/   sd   ,,Xv>##%11"5::|$))H% W73X~<<7" g>B>!  	! )B= =	!
 *G3/g>z **, 	)CK

0wt) 

7A	) %W-z!  )(1B=(=)) )	)" **, 	)**CK

7bQUV
)

7<
) %W-z!  )(1B=(=)
) 
)	) **, 	&GGFD! 

0jQU& 

7A	& %W-X~%~& & 

0wt& 

7<	& %W-X~%~& &	& 	&U	! 	!,) )) ) ) )	) 	)6) )
) 
) 
) 
)	) 	)&& & & && & & &	& 	&s   KL;K6K)$K	8K) K6L,,L7L*/LL	LL*%L7	/M48MM#M+ M4M("M6M(>M4KK&!K))K3.K66L 	;LLLLL'"L**L4	/L77MM	MM	M4M%!M((M1	-M44M=c                     | j                  d      j                  |      }|j                  dd       |j                  t        j
                         |S )Nr2   r   zutf-8)encoding)joinpathr&   
write_textr   statS_IXUSR)r0   extr2   s      r   r$   zTestSpawn._make_executable   sG     ##I.::3?20dll#    c                     t        j                  t              5 }t        dg       d d d        dt	        j
                        v sJ y # 1 sw Y   #xY w)Nzdoes-not-existzcommand 'does-not-exist' failed)r   r   r   r   r'   value)r   ctxs     r   test_spawn_missing_exez TestSpawn.test_spawn_missing_exe   sH    ]]-. 	&##$%	&0C		NBBB	& 	&s   A		AN)__name__
__module____qualname__r   markskipifr   r9   staticmethodr$   rE    rA   r   r   r      sE    [[89 :6P&d  CrA   r   )__doc__r   r>   r   unittest.mockr+   distutils.errorsr   distutils.spawnr   r   distutils.testsr   r   r   test.supportr   compatr	   r)   TempdirManagerr   rL   rA   r   <module>rU      s?      	  
  / 2 #   # %{C&& {CrA   