
    ;eZ
                         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ej        ej        ej                  Zd	 Zed
k    r e
 e                       dS dS )z,Tests for distutils.command.install_scripts.    N)install_scripts)Distribution)support)run_unittestc                       e Zd Zd Zd ZdS )InstallScriptsTestCasec                    t                      }t          j        d          |j        d<   t          j        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cmds      ;/usr/lib/python3.11/distutils/tests/test_install_scripts.pytest_default_settingsz,InstallScriptsTestCase.test_default_settings   s,   ~~$+$8$%& %& %&!&-&:)' ' '#
 d#####(((#-(((#/***	"""'''
333-88888    c                    |                                  g fd} |dd            |dd            |dd           |                                  }t                      }t          j                  |j        d	<   t          j        |d
d
          |j        d<   t          |          }|                                 |                                 t          j	        |          }D ]}| 
                    ||           d S )Nc                                         |            t          t          j                            |           d          }	 |                    |           |                                 d S # |                                 w xY w)Nw)appendopenospathjoinwriteclose)nametextfexpectedsources      r   write_scriptz>InstallScriptsTestCase.test_installation.<locals>.write_script+   sk    OOD!!!RW\\&$//55A									s   A1 1Bz
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   )mkdtempr   r   r   r   r   r   runr&   listdirassertIn)	r   r0   targetr   r   	installedr+   r.   r/   s	          @@r   test_installationz(InstallScriptsTestCase.test_installation'   sS   	 	 	 	 	 	 	\ %- 	/ 	/ 	/ 	\ %- 	/ 	/ 	/ 	Z #- 	/ 	/ 	/ ~~$+$8v$N$N$N!&-&:"' ' '#
 d##			Jv&&	 	+ 	+DMM$	****	+ 	+r    N)__name__
__module____qualname__r   r7    r    r   r   r      s2        9 9 9,$+ $+ $+ $+ $+r    r   c                  X    t          j                                        t                    S )N)unittest
TestLoaderloadTestsFromTestCaser   r;   r    r   
test_suiter@   N   s       667MNNNr    __main__)__doc__r&   r=   !distutils.command.install_scriptsr   distutils.corer   distutils.testsr   test.supportr   TempdirManagerLoggingSilencerTestCaser   r@   r8   r;   r    r   <module>rJ      s    2 2 				  = = = = = = ' ' ' ' ' ' # # # # # # % % % % % %>+ >+ >+ >+ >+W3$4%.>+ >+ >+BO O O zL r    