]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/tests/test_core.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / distutils / tests / test_core.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/tests/test_core.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/tests/test_core.py
deleted file mode 100644 (file)
index 5c13efe..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-"""Tests for distutils.core."""\r
-\r
-import StringIO\r
-import distutils.core\r
-import os\r
-import shutil\r
-import sys\r
-import test.test_support\r
-from test.test_support import captured_stdout, run_unittest\r
-import unittest\r
-from distutils.tests import support\r
-\r
-# setup script that uses __file__\r
-setup_using___file__ = """\\r
-\r
-__file__\r
-\r
-from distutils.core import setup\r
-setup()\r
-"""\r
-\r
-setup_prints_cwd = """\\r
-\r
-import os\r
-print os.getcwd()\r
-\r
-from distutils.core import setup\r
-setup()\r
-"""\r
-\r
-\r
-class CoreTestCase(support.EnvironGuard, unittest.TestCase):\r
-\r
-    def setUp(self):\r
-        super(CoreTestCase, self).setUp()\r
-        self.old_stdout = sys.stdout\r
-        self.cleanup_testfn()\r
-        self.old_argv = sys.argv, sys.argv[:]\r
-\r
-    def tearDown(self):\r
-        sys.stdout = self.old_stdout\r
-        self.cleanup_testfn()\r
-        sys.argv = self.old_argv[0]\r
-        sys.argv[:] = self.old_argv[1]\r
-        super(CoreTestCase, self).tearDown()\r
-\r
-    def cleanup_testfn(self):\r
-        path = test.test_support.TESTFN\r
-        if os.path.isfile(path):\r
-            os.remove(path)\r
-        elif os.path.isdir(path):\r
-            shutil.rmtree(path)\r
-\r
-    def write_setup(self, text, path=test.test_support.TESTFN):\r
-        f = open(path, "w")\r
-        try:\r
-            f.write(text)\r
-        finally:\r
-            f.close()\r
-        return path\r
-\r
-    def test_run_setup_provides_file(self):\r
-        # Make sure the script can use __file__; if that's missing, the test\r
-        # setup.py script will raise NameError.\r
-        distutils.core.run_setup(\r
-            self.write_setup(setup_using___file__))\r
-\r
-    def test_run_setup_uses_current_dir(self):\r
-        # This tests that the setup script is run with the current directory\r
-        # as its own current directory; this was temporarily broken by a\r
-        # previous patch when TESTFN did not use the current directory.\r
-        sys.stdout = StringIO.StringIO()\r
-        cwd = os.getcwd()\r
-\r
-        # Create a directory and write the setup.py file there:\r
-        os.mkdir(test.test_support.TESTFN)\r
-        setup_py = os.path.join(test.test_support.TESTFN, "setup.py")\r
-        distutils.core.run_setup(\r
-            self.write_setup(setup_prints_cwd, path=setup_py))\r
-\r
-        output = sys.stdout.getvalue()\r
-        if output.endswith("\n"):\r
-            output = output[:-1]\r
-        self.assertEqual(cwd, output)\r
-\r
-    def test_debug_mode(self):\r
-        # this covers the code called when DEBUG is set\r
-        sys.argv = ['setup.py', '--name']\r
-        with captured_stdout() as stdout:\r
-            distutils.core.setup(name='bar')\r
-        stdout.seek(0)\r
-        self.assertEqual(stdout.read(), 'bar\n')\r
-\r
-        distutils.core.DEBUG = True\r
-        try:\r
-            with captured_stdout() as stdout:\r
-                distutils.core.setup(name='bar')\r
-        finally:\r
-            distutils.core.DEBUG = False\r
-        stdout.seek(0)\r
-        wanted = "options (after parsing config files):\n"\r
-        self.assertEqual(stdout.readlines()[0], wanted)\r
-\r
-def test_suite():\r
-    return unittest.makeSuite(CoreTestCase)\r
-\r
-if __name__ == "__main__":\r
-    run_unittest(test_suite())\r