/opt/imh-python/lib/python3.9/distutils/tests
NameSizeModeActions
__pycache__/-0755rm
includetest.rst250644editdlrm
Setup.sample22490644editdlrm
support.py64780644editdlrm
test_archive_util.py143010644editdlrm
test_bdist.py18930644editdlrm
test_bdist_dumb.py29050644editdlrm
test_bdist_msi.py8030644editdlrm
test_bdist_rpm.py50080644editdlrm
test_bdist_wininst.py13900644editdlrm
test_build.py19650644editdlrm
test_build_clib.py46310644editdlrm
test_build_ext.py206330644editdlrm
test_build_py.py63350644editdlrm
test_build_scripts.py35930644editdlrm
test_check.py57110644editdlrm
test_clean.py14410644editdlrm
test_cmd.py38350644editdlrm
test_config.py38920644editdlrm
test_config_cmd.py30230644editdlrm
test_core.py40770644editdlrm
test_cygwinccompiler.py56360644editdlrm
test_dep_util.py28200644editdlrm
test_dir_util.py46540644editdlrm
test_dist.py190800644editdlrm
test_extension.py27680644editdlrm
test_filelist.py114750644editdlrm
test_file_util.py44130644editdlrm
test_install.py86120644editdlrm
test_install_data.py25770644editdlrm
test_install_headers.py12380644editdlrm
test_install_lib.py39740644editdlrm
test_install_scripts.py26250644editdlrm
test_log.py18640644editdlrm
test_msvc9compiler.py60380644editdlrm
test_msvccompiler.py28450644editdlrm
test_register.py97650644editdlrm
test_sdist.py170470644editdlrm
test_spawn.py54600644editdlrm
test_sysconfig.py110450644editdlrm
test_text_file.py34360644editdlrm
test_unixccompiler.py46280644editdlrm
test_upload.py71370644editdlrm
test_util.py115720644editdlrm
test_version.py34500644editdlrm
test_versionpredicate.py2800644editdlrm
xxmodule.c129150644editdlrm
__init__.py13440644editdlrm
Edit: /opt/imh-python/lib/python3.9/distutils/tests/test_msvc9compiler.py (6038B)
"""Tests for distutils.msvc9compiler.""" import sys import unittest import os from distutils.errors import DistutilsPlatformError from distutils.tests import support from test.support import run_unittest # A manifest with the only assembly reference being the msvcrt assembly, so # should have the assembly completely stripped. Note that although the # assembly has a reference the assembly is removed - that is # currently a "feature", not a bug :) _MANIFEST_WITH_ONLY_MSVC_REFERENCE = """\ """ # A manifest with references to assemblies other than msvcrt. When processed, # this assembly should be returned with just the msvcrt part removed. _MANIFEST_WITH_MULTIPLE_REFERENCES = """\ """ _CLEANED_MANIFEST = """\ """ if sys.platform=="win32": from distutils.msvccompiler import get_build_version if get_build_version()>=8.0: SKIP_MESSAGE = None else: SKIP_MESSAGE = "These tests are only for MSVC8.0 or above" else: SKIP_MESSAGE = "These tests are only for win32" @unittest.skipUnless(SKIP_MESSAGE is None, SKIP_MESSAGE) class msvc9compilerTestCase(support.TempdirManager, unittest.TestCase): def test_no_compiler(self): # makes sure query_vcvarsall raises # a DistutilsPlatformError if the compiler # is not found from distutils.msvc9compiler import query_vcvarsall def _find_vcvarsall(version): return None from distutils import msvc9compiler old_find_vcvarsall = msvc9compiler.find_vcvarsall msvc9compiler.find_vcvarsall = _find_vcvarsall try: self.assertRaises(DistutilsPlatformError, query_vcvarsall, 'wont find this version') finally: msvc9compiler.find_vcvarsall = old_find_vcvarsall def test_reg_class(self): from distutils.msvc9compiler import Reg self.assertRaises(KeyError, Reg.get_value, 'xxx', 'xxx') # looking for values that should exist on all # windows registry versions. path = r'Control Panel\Desktop' v = Reg.get_value(path, 'dragfullwindows') self.assertIn(v, ('0', '1', '2')) import winreg HKCU = winreg.HKEY_CURRENT_USER keys = Reg.read_keys(HKCU, 'xxxx') self.assertEqual(keys, None) keys = Reg.read_keys(HKCU, r'Control Panel') self.assertIn('Desktop', keys) def test_remove_visual_c_ref(self): from distutils.msvc9compiler import MSVCCompiler tempdir = self.mkdtemp() manifest = os.path.join(tempdir, 'manifest') f = open(manifest, 'w') try: f.write(_MANIFEST_WITH_MULTIPLE_REFERENCES) finally: f.close() compiler = MSVCCompiler() compiler._remove_visual_c_ref(manifest) # see what we got f = open(manifest) try: # removing trailing spaces content = '\n'.join([line.rstrip() for line in f.readlines()]) finally: f.close() # makes sure the manifest was properly cleaned self.assertEqual(content, _CLEANED_MANIFEST) def test_remove_entire_manifest(self): from distutils.msvc9compiler import MSVCCompiler tempdir = self.mkdtemp() manifest = os.path.join(tempdir, 'manifest') f = open(manifest, 'w') try: f.write(_MANIFEST_WITH_ONLY_MSVC_REFERENCE) finally: f.close() compiler = MSVCCompiler() got = compiler._remove_visual_c_ref(manifest) self.assertIsNone(got) def test_suite(): return unittest.makeSuite(msvc9compilerTestCase) if __name__ == "__main__": run_unittest(test_suite())