ruạṛ
a �u:ji � @ sJ d Z ddlZddlZddlmZ ddlmZ ddlmZ G dd� d�Z dS ) zinstall_scripts tests� N)�install_scripts)�Distribution� )�contextsc @ s� e Zd Zedddgidd�ZdZdZdZdd d�Ze j jej dkd d�dd� �Ze j jej dkdd�dd� �Ze j jej dkd d�dd� �Ze j jej dkdd�dd� �Zd S )�TestInstallScripts�foo�console_scriptszfoo=foo:fooz0.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 C sr t | j�}d|_t|�}||_|d ur6|�d�}||_|�� t� � � |� � W d � n1 sd0 Y d S )Nzsetup.py� build_scripts)r �settings�script_namer �install_dir�get_finalized_command� executable�ensure_finalizedr �quiet�run)�selfr r �dist�cmd�bs� r �X/opt/bart/bart_venv/lib/python3.9/site-packages/setuptools/tests/test_install_scripts.py�_run_install_scripts s z'TestInstallScripts._run_install_scripts�win32znon-Windows only)�reasonc C s� d| j � d�}|�d| j � |�� �^ | �t|�� tt|�d��ddd��}|�� }W d � n1 sj0 Y W d � n1 s�0 Y ||ks�J �dS ) 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 �tmpdirZmonkeypatch�expected�f�actualr r r �!test_sys_executable_escaping_unix# s Dz4TestInstallScripts.test_sys_executable_escaping_unixzWindows onlyc C s� d| j � d�}|�d| j � |�� �^ | �t|�� tt|�d��ddd��}|�� }W d � n1 sj0 Y W d � n1 s�0 Y ||ks�J �dS ) 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"