PATH: //opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools/tests
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 __init__.py
↓
X
📁 __pycache__/
X
📁 compat/
X
📁 config/
X
📄 contexts.py
↓
X
📄 environment.py
↓
X
📄 fixtures.py
↓
X
📁 indexes/
X
📁 integration/
X
📄 mod_with_constant.py
↓
X
📄 namespaces.py
↓
X
📄 script-with-bom.py
↓
X
📄 server.py
↓
X
📄 test_archive_util.py
↓
X
📄 test_bdist_deprecations.py
↓
X
📄 test_bdist_egg.py
↓
X
📄 test_bdist_wheel.py
↓
X
📄 test_build.py
↓
X
📄 test_build_clib.py
↓
X
📄 test_build_ext.py
↓
X
📄 test_build_meta.py
↓
X
📄 test_build_py.py
↓
X
📄 test_config_discovery.py
↓
X
📄 test_core_metadata.py
↓
X
📄 test_depends.py
↓
X
📄 test_develop.py
↓
X
📄 test_dist.py
↓
X
📄 test_dist_info.py
↓
X
📄 test_distutils_adoption.py
↓
X
📄 test_easy_install.py
↓
X
📄 test_editable_install.py
↓
X
📄 test_egg_info.py
↓
X
📄 test_extern.py
↓
X
📄 test_find_packages.py
↓
X
📄 test_find_py_modules.py
↓
X
📄 test_glob.py
↓
X
📄 test_install_scripts.py
↓
X
📄 test_logging.py
↓
X
📄 test_manifest.py
↓
X
📄 test_namespaces.py
↓
X
📄 test_packageindex.py
↓
X
📄 test_sandbox.py
↓
X
📄 test_sdist.py
↓
X
📄 test_setopt.py
↓
X
📄 test_setuptools.py
↓
X
📄 test_shutil_wrapper.py
↓
X
📄 test_unicode_utils.py
↓
X
📄 test_virtualenv.py
↓
X
📄 test_warnings.py
↓
X
📄 test_wheel.py
↓
X
📄 test_windows_wrappers.py
↓
X
📄 text.py
↓
X
📄 textwrap.py
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: test_install_scripts.py
"""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
SIMPAN PERUBAHAN