a  zeA @sxddlZddlZddlmZddlmZddlmZddlm Z Gdddej ej ej Z dd Zed krte edS) N)install_scripts) Distribution)support) run_unittestc@seZdZddZddZdS)InstallScriptsTestCasecCst}tjdd|jd<tjdddd|jd<t|}||j||j||j ||j | | |j| |j| |j d| |j ddS)Nz/foo/barZ build_scriptsbuildz /splat/funkrforce skip_buildinstall)rr DummyCommand command_objrZ assertFalser r Z assertIsNoneZ build_dirZ install_dirfinalize_optionsZ assertTrueZ assertEqual)selfdistcmdrX/opt/bitninja-python-dojo/embedded/lib/python3.9/distutils/tests/test_install_scripts.pytest_default_settingss&        z,InstallScriptsTestCase.test_default_settingscs|gfdd}|dd|dd|dd|}t}tjd |jd <tj|d d d |jd <t|}||t |}D]}| ||qdS)NcsD|ttj|d}z||W|n |0dS)Nw)appendopenospathjoinwriteclose)nametextfZexpectedsourcerr 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 ) mkdtemprrrrrrrunrlistdirZassertIn)rr$targetrrZ installedrrr"rtest_installation's(     z(InstallScriptsTestCase.test_installationN)__name__ __module__ __qualname__rr)rrrrr srcCs ttS)N)unittestZ makeSuiterrrrr test_suiteNsr.__main__)rr-Z!distutils.command.install_scriptsrZdistutils.corerZdistutils.testsrZ test.supportrZTempdirManagerZLoggingSilencerZTestCaserr.r*rrrrs    A