PATH: //proc/self/root/opt/alt/python311/lib64/python3.11/distutils/tests
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 Setup.sample
↓
X
📄 __init__.py
↓
X
📁 __pycache__/
X
📄 includetest.rst
↓
X
📄 support.py
↓
X
📄 test_archive_util.py
↓
X
📄 test_bdist.py
↓
X
📄 test_bdist_dumb.py
↓
X
📄 test_bdist_rpm.py
↓
X
📄 test_build.py
↓
X
📄 test_build_clib.py
↓
X
📄 test_build_ext.py
↓
X
📄 test_build_py.py
↓
X
📄 test_build_scripts.py
↓
X
📄 test_check.py
↓
X
📄 test_clean.py
↓
X
📄 test_cmd.py
↓
X
📄 test_config.py
↓
X
📄 test_config_cmd.py
↓
X
📄 test_core.py
↓
X
📄 test_cygwinccompiler.py
↓
X
📄 test_dep_util.py
↓
X
📄 test_dir_util.py
↓
X
📄 test_dist.py
↓
X
📄 test_extension.py
↓
X
📄 test_file_util.py
↓
X
📄 test_filelist.py
↓
X
📄 test_install.py
↓
X
📄 test_install_data.py
↓
X
📄 test_install_headers.py
↓
X
📄 test_install_lib.py
↓
X
📄 test_install_scripts.py
↓
X
📄 test_log.py
↓
X
📄 test_msvc9compiler.py
↓
X
📄 test_msvccompiler.py
↓
X
📄 test_register.py
↓
X
📄 test_sdist.py
↓
X
📄 test_spawn.py
↓
X
📄 test_sysconfig.py
↓
X
📄 test_text_file.py
↓
X
📄 test_unixccompiler.py
↓
X
📄 test_upload.py
↓
X
📄 test_util.py
↓
X
📄 test_version.py
↓
X
📄 test_versionpredicate.py
↓
X
📄 xxmodule.c
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: test_build_scripts.py
"""Tests for distutils.command.build_scripts.""" import os import unittest from distutils.command.build_scripts import build_scripts from distutils.core import Distribution from distutils import sysconfig from distutils.tests import support class BuildScriptsTestCase(support.TempdirManager, support.LoggingSilencer, unittest.TestCase): def test_default_settings(self): cmd = self.get_build_scripts_cmd("/foo/bar", []) self.assertFalse(cmd.force) self.assertIsNone(cmd.build_dir) cmd.finalize_options() self.assertTrue(cmd.force) self.assertEqual(cmd.build_dir, "/foo/bar") def test_build(self): source = self.mkdtemp() target = self.mkdtemp() expected = self.write_sample_scripts(source) cmd = self.get_build_scripts_cmd(target, [os.path.join(source, fn) for fn in expected]) cmd.finalize_options() cmd.run() built = os.listdir(target) for name in expected: self.assertIn(name, built) def get_build_scripts_cmd(self, target, scripts): import sys dist = Distribution() dist.scripts = scripts dist.command_obj["build"] = support.DummyCommand( build_scripts=target, force=1, executable=sys.executable ) return build_scripts(dist) def write_sample_scripts(self, dir): expected = [] expected.append("script1.py") self.write_script(dir, "script1.py", ("#! /usr/bin/env python2.3\n" "# bogus script w/ Python sh-bang\n" "pass\n")) expected.append("script2.py") self.write_script(dir, "script2.py", ("#!/usr/bin/python\n" "# bogus script w/ Python sh-bang\n" "pass\n")) expected.append("shell.sh") self.write_script(dir, "shell.sh", ("#!/bin/sh\n" "# bogus shell script w/ sh-bang\n" "exit 0\n")) return expected def write_script(self, dir, name, text): f = open(os.path.join(dir, name), "w") try: f.write(text) finally: f.close() def test_version_int(self): source = self.mkdtemp() target = self.mkdtemp() expected = self.write_sample_scripts(source) cmd = self.get_build_scripts_cmd(target, [os.path.join(source, fn) for fn in expected]) cmd.finalize_options() # http://bugs.python.org/issue4524 # # On linux-g++-32 with command line `./configure --enable-ipv6 # --with-suffix=3`, python is compiled okay but the build scripts # failed when writing the name of the executable old = sysconfig.get_config_vars().get('VERSION') sysconfig._config_vars['VERSION'] = 4 try: cmd.run() finally: if old is not None: sysconfig._config_vars['VERSION'] = old built = os.listdir(target) for name in expected: self.assertIn(name, built) if __name__ == "__main__": unittest.main()
SIMPAN PERUBAHAN