a :êdgA ã@sxddlZddlZddlmZddlmZddlmZddlm Z Gdd„dej ej ej ƒZ dd „Zed krte eƒƒdS) éN)Úinstall_scripts)Ú Distribution)Úsupport)Ú run_unittestc@seZdZdd„Zdd„ZdS)ÚInstallScriptsTestCasecCs¦tƒ}tjdd|jd<tjdddd|jd<t|ƒ}| |j¡| |j¡| |j ¡| |j ¡|  ¡|  |j¡|  |j¡|  |j d¡|  |j d¡dS)Nz/foo/bar©Z build_scriptsÚbuildz /splat/funké©rÚforceÚ skip_buildÚinstall)rrÚ DummyCommandÚ command_objrZ assertFalser r Z assertIsNoneZ build_dirZ install_dirÚfinalize_optionsZ assertTrueZ assertEqual)ÚselfÚdistÚcmd©rú@/usr/local/lib/python3.9/distutils/tests/test_install_scripts.pyÚtest_default_settingss&ÿ ý       z,InstallScriptsTestCase.test_default_settingscsª| ¡‰g‰‡‡fdd„}|ddƒ|ddƒ|ddƒ| ¡}tƒ}tjˆd |jd <tj|d d d |jd <t|ƒ}| ¡| ¡t  |¡}ˆD]}|  ||¡q”dS)NcsDˆ |¡ttj ˆ|¡dƒ}z| |¡W| ¡n | ¡0dS)NÚw)ÚappendÚopenÚosÚpathÚjoinÚwriteÚclose)ÚnameÚtextÚf©ZexpectedÚsourcerrÚ write_script+s   z>InstallScriptsTestCase.test_installation..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 zshell.shz1#!/bin/sh # bogus shell script w/ sh-bang exit 0 rrr r r ) ÚmkdtemprrrrrrÚrunrÚlistdirZassertIn)rr$ÚtargetrrZ installedrrr"rÚtest_installation's(   ý  z(InstallScriptsTestCase.test_installationN)Ú__name__Ú __module__Ú __qualname__rr)rrrrr srcCs t t¡S)N)ÚunittestZ makeSuiterrrrrÚ test_suiteNsr.Ú__main__)rr-Z!distutils.command.install_scriptsrZdistutils.corerZdistutils.testsrZ test.supportrZTempdirManagerZLoggingSilencerZTestCaserr.r*rrrrÚs    þA