B
    u9a0  ã               @   sr   d Z ddlmZ ddlZddlZddlZddlZe ejdkoFe 	d¡d¡G dd„ dej
ƒƒZed	krne ¡  dS )
z8
Test suite for OS X interpreter environment variables.
é    )ÚEnvironmentVarGuardNÚdarwinZWITH_NEXT_FRAMEWORKzunnecessary on this platformc               @   s&   e Zd Zejd fdd„Zdd„ ZdS )ÚOSXEnvironmentVariableTestCaseZdummyc          	   C   sŠ   t ƒ z}ttjƒdd|||f g}| |¡ t |¡}|  |dd|||f ¡ | ||¡ t |¡}|  |dd|||f ¡ W d Q R X d S )Nz-cz,import sys; sys.exit(2 if "%s" %s %s else 3)é   zexpected %s not %s %sé   zexpected %s %s %s)	r   ÚstrÚsysÚ
executableZunsetÚ
subprocessZcallZassertEqualÚset)ÚselfZevZcondÚsvÚvalZevgZsubpcZrc© r   ú"/usr/lib/python3.7/test_osx_env.pyÚ
_check_sys   s    



z)OSXEnvironmentVariableTestCase._check_sysc             C   s   |   ddd¡ d S )NZPYTHONEXECUTABLEz==zsys.executable)r   )r   r   r   r   Ú)test_pythonexecutable_sets_sys_executable   s    zHOSXEnvironmentVariableTestCase.test_pythonexecutable_sets_sys_executableN)Ú__name__Ú
__module__Ú__qualname__r   r	   r   r   r   r   r   r   r      s   r   Ú__main__)Ú__doc__Ztest.supportr   r
   r   Z	sysconfigZunittestZ
skipUnlessÚplatformZget_config_varZTestCaser   r   Úmainr   r   r   r   Ú<module>   s   
