B
    18\A
                 @   s|   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 ddl	m
Z
 G dd dejejejZd	d
 Zedkrxe
e  dS )z,Tests for distutils.command.install_scripts.    N)install_scripts)Distribution)support)run_unittestc               @   s   e Zd Zdd Zdd ZdS )InstallScriptsTestCasec             C   s   t  }tjdd|jd< tjdddd|jd< t|}| |j | |j | |j	 | |j
 |  | |j | |j | |j	d | |j
d d S )Nz/foo/bar)build_scriptsbuildz/splat/funk   )r   force
skip_buildinstall)r   r   DummyCommandcommand_objr   assertFalser
   r   assertIsNone	build_dirinstall_dirfinalize_options
assertTrueassertEqual)selfdistcmd r   h/oak/stanford/groups/akundaje/marinovg/programs/Python-3.7.3/Lib/distutils/tests/test_install_scripts.pytest_default_settings   s"    z,InstallScriptsTestCase.test_default_settingsc                s   |   g   fdd}|dd |dd |dd |   }t }tjd	|jd
< tj|ddd|jd< t|}|  |  t	|}x D ]}| 
|| qW d S )Nc                s<     |  ttj| d}z|| W d |  X d S )Nw)appendopenospathjoinwriteclose)nametextf)expectedsourcer   r   write_script+   s
    
z>InstallScriptsTestCase.test_installation.<locals>.write_scriptz
script1.pyz@#! /usr/bin/env python2.3
# bogus script w/ Python sh-bang
pass
z
script2.pyz8#!/usr/bin/python
# bogus script w/ Python sh-bang
pass
zshell.shz1#!/bin/sh
# bogus shell script w/ sh-bang
exit 0
)r   r   r	   )r   r
   r   r   )mkdtempr   r   r   r   r   r   runr   listdirassertIn)r   r)   targetr   r   Z	installedr$   r   )r'   r(   r   test_installation'   s&    




z(InstallScriptsTestCase.test_installationN)__name__
__module____qualname__r   r/   r   r   r   r   r      s   r   c               C   s
   t tS )N)unittest	makeSuiter   r   r   r   r   
test_suiteN   s    r5   __main__)__doc__r   r3   Z!distutils.command.install_scriptsr   distutils.corer   distutils.testsr   Ztest.supportr   TempdirManagerLoggingSilencerTestCaser   r5   r0   r   r   r   r   <module>   s   ?