/opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools/tests
NameSizeModeActions
compat/-0755rm
config/-0755rm
indexes/-0755rm
integration/-0755rm
__pycache__/-0755rm
contexts.py31660644editdlrm
environment.py31020644editdlrm
fixtures.py122240644editdlrm
mod_with_constant.py220644editdlrm
namespaces.py27740644editdlrm
script-with-bom.py180644editdlrm
test_archive_util.py8450644editdlrm
test_bdist_deprecations.py7750644editdlrm
test_bdist_egg.py19570644editdlrm
test_bdist_wheel.py230910644editdlrm
test_build.py7980644editdlrm
test_build_clib.py31230644editdlrm
test_build_ext.py100990644editdlrm
test_build_meta.py333200644editdlrm
test_build_py.py142010644editdlrm
test_config_discovery.py225800644editdlrm
test_core_metadata.py180380644editdlrm
test_depends.py4240644editdlrm
test_develop.py30720644editdlrm
test_dist.py89510644editdlrm
test_distutils_adoption.py59870644editdlrm
test_dist_info.py50050644editdlrm
test_editable_install.py426190644editdlrm
test_egg_info.py449410644editdlrm
test_extern.py2960644editdlrm
test_find_packages.py78190644editdlrm
test_find_py_modules.py24040644editdlrm
test_glob.py8870644editdlrm
test_install_scripts.py34330644editdlrm
test_logging.py20960644editdlrm
test_manifest.py185620644editdlrm
test_namespaces.py45150644editdlrm
test_scripts.py3790644editdlrm
test_sdist.py328080644editdlrm
test_setopt.py13650644editdlrm
test_setuptools.py90080644editdlrm
test_shutil_wrapper.py6410644editdlrm
test_unicode_utils.py3160644editdlrm
test_virtualenv.py37300644editdlrm
test_warnings.py33470644editdlrm
test_wheel.py187220644editdlrm
test_windows_wrappers.py78680644editdlrm
text.py1230644editdlrm
textwrap.py980644editdlrm
__init__.py3350644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools/tests/test_install_scripts.py (3433B)
"""install_scripts tests""" import sys import pytest from setuptools.command.install_scripts import install_scripts from setuptools.dist import Distribution from . import contexts class TestInstallScripts: settings = dict( name='foo', entry_points={'console_scripts': ['foo=foo:foo']}, version='0.0', ) unix_exe = '/usr/dummy-test-path/local/bin/python' unix_spaces_exe = '/usr/bin/env dummy-test-python' win32_exe = 'C:\\Dummy Test Path\\Program Files\\Python 3.6\\python.exe' def _run_install_scripts(self, install_dir, executable=None): dist = Distribution(self.settings) dist.script_name = 'setup.py' cmd = install_scripts(dist) cmd.install_dir = install_dir if executable is not None: bs = cmd.get_finalized_command('build_scripts') bs.executable = executable cmd.ensure_finalized() with contexts.quiet(): cmd.run() @pytest.mark.skipif(sys.platform == 'win32', reason='non-Windows only') def test_sys_executable_escaping_unix(self, tmpdir, monkeypatch): """ Ensure that shebang is not quoted on Unix when getting the Python exe from sys.executable. """ expected = f'#!{self.unix_exe}\n' monkeypatch.setattr('sys.executable', self.unix_exe) with tmpdir.as_cwd(): self._run_install_scripts(str(tmpdir)) with open(str(tmpdir.join('foo')), 'r', encoding="utf-8") as f: actual = f.readline() assert actual == expected @pytest.mark.skipif(sys.platform != 'win32', reason='Windows only') def test_sys_executable_escaping_win32(self, tmpdir, monkeypatch): """ Ensure that shebang is quoted on Windows when getting the Python exe from sys.executable and it contains a space. """ expected = f'#!"{self.win32_exe}"\n' monkeypatch.setattr('sys.executable', self.win32_exe) with tmpdir.as_cwd(): self._run_install_scripts(str(tmpdir)) with open(str(tmpdir.join('foo-script.py')), 'r', encoding="utf-8") as f: actual = f.readline() assert actual == expected @pytest.mark.skipif(sys.platform == 'win32', reason='non-Windows only') def test_executable_with_spaces_escaping_unix(self, tmpdir): """ Ensure that shebang on Unix is not quoted, even when a value with spaces is specified using --executable. """ expected = f'#!{self.unix_spaces_exe}\n' with tmpdir.as_cwd(): self._run_install_scripts(str(tmpdir), self.unix_spaces_exe) with open(str(tmpdir.join('foo')), 'r', encoding="utf-8") as f: actual = f.readline() assert actual == expected @pytest.mark.skipif(sys.platform != 'win32', reason='Windows only') def test_executable_arg_escaping_win32(self, tmpdir): """ Ensure that shebang on Windows is quoted when getting a path with spaces from --executable, that is itself properly quoted. """ expected = f'#!"{self.win32_exe}"\n' with tmpdir.as_cwd(): self._run_install_scripts(str(tmpdir), '"' + self.win32_exe + '"') with open(str(tmpdir.join('foo-script.py')), 'r', encoding="utf-8") as f: actual = f.readline() assert actual == expected