
    c                     F    d dl mZmZ d dlmZ d dlZd dlZd dlZd Zd Z	dS )    )absolute_importprint_function)CommandExecInfoNc                 v   t          j                    dk    rd S i fd}|                     d|           t          t	          j                    dgdt          d                    }|                                 d	         d
k    sJ d         g dk    sJ d         t          d          k    sJ d S )NWindowsc                 &    | d<   |d<   |d<   d S )Nfileargsenv )r	   r
   r   executeds      Klib/python3.11/site-packages/anaconda_project/test/test_project_commands.pymock_execvpez5test_execvpe_with_shell_on_unix.<locals>.mock_execvpe   s$        z
os.execvpefoo barTbarFOOcwdr
   shellr   r	   /bin/shr
   )r   z-cr   r   )platformsystemsetattrr   osgetcwddictexecvpe)monkeypatchr   infor   s      @r   test_execvpe_with_shell_on_unixr"      s    I% H    
 l333ry{{)DdW\ooo^^^DLLNNNFy((((F;;;;;;;E?duooo------r   c                    d }|                      d|           i fd}|                      d|           t          ddgdt          d	          
          }t          j        t
                    5 }|                                 d d d            n# 1 swxY w Y   |j        j        dk    sJ d         dk    sJ d         du sJ d         t          d	          k    sJ d         dk    sJ d S )Nc                      dS )Nr   r   r   r   r   mock_platform_systemz@test_execvpe_with_shell_on_windows.<locals>.mock_platform_system'   s    yr   zplatform.systemc                 f    | d<   |d<   |d<   |d<    G d dt                     } |            S )Nr
   r   r   r   c                       e Zd Zd ZdS )Ktest_execvpe_with_shell_on_windows.<locals>.mock_popen.<locals>.MockProcessc                     dS )Nr   r   )selfs    r   waitzPtest_execvpe_with_shell_on_windows.<locals>.mock_popen.<locals>.MockProcess.wait5   s    qr   N)__name__
__module____qualname__r+   r   r   r   MockProcessr(   4   s#            r   r/   )object)r
   r   r   r   r/   r   s        r   
mock_popenz6test_execvpe_with_shell_on_windows.<locals>.mock_popen.   sa    !	 	 	 	 	& 	 	 	 {}}r   zsubprocess.Popenz
/somewherer   Tr   r   r   r   r
   r   r   r   )	r   r   r   pytestraises
SystemExitr   valuecode)r    r%   r1   r!   excinfor   s        @r   "test_execvpe_with_shell_on_windowsr8   &   sm      )+?@@@H
 
 
 
 
 *J777|9+TtX]___D	z	"	" g              =""""Fy((((G$$$$E?duooo----E?l******s   3BBB)

__future__r   r   !anaconda_project.project_commandsr   r   r   r2   r"   r8   r   r   r   <module>r;      st    7 6 6 6 6 6 6 6 = = = = = = 				  . . .*+ + + + +r   