]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/tests/test_check.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / distutils / tests / test_check.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/tests/test_check.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/tests/test_check.py
deleted file mode 100644 (file)
index e0b82ca..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-"""Tests for distutils.command.check."""\r
-import unittest\r
-from test.test_support import run_unittest\r
-\r
-from distutils.command.check import check, HAS_DOCUTILS\r
-from distutils.tests import support\r
-from distutils.errors import DistutilsSetupError\r
-\r
-class CheckTestCase(support.LoggingSilencer,\r
-                    support.TempdirManager,\r
-                    unittest.TestCase):\r
-\r
-    def _run(self, metadata=None, **options):\r
-        if metadata is None:\r
-            metadata = {}\r
-        pkg_info, dist = self.create_dist(**metadata)\r
-        cmd = check(dist)\r
-        cmd.initialize_options()\r
-        for name, value in options.items():\r
-            setattr(cmd, name, value)\r
-        cmd.ensure_finalized()\r
-        cmd.run()\r
-        return cmd\r
-\r
-    def test_check_metadata(self):\r
-        # let's run the command with no metadata at all\r
-        # by default, check is checking the metadata\r
-        # should have some warnings\r
-        cmd = self._run()\r
-        self.assertEqual(cmd._warnings, 2)\r
-\r
-        # now let's add the required fields\r
-        # and run it again, to make sure we don't get\r
-        # any warning anymore\r
-        metadata = {'url': 'xxx', 'author': 'xxx',\r
-                    'author_email': 'xxx',\r
-                    'name': 'xxx', 'version': 'xxx'}\r
-        cmd = self._run(metadata)\r
-        self.assertEqual(cmd._warnings, 0)\r
-\r
-        # now with the strict mode, we should\r
-        # get an error if there are missing metadata\r
-        self.assertRaises(DistutilsSetupError, self._run, {}, **{'strict': 1})\r
-\r
-        # and of course, no error when all metadata are present\r
-        cmd = self._run(metadata, strict=1)\r
-        self.assertEqual(cmd._warnings, 0)\r
-\r
-    def test_check_document(self):\r
-        if not HAS_DOCUTILS: # won't test without docutils\r
-            return\r
-        pkg_info, dist = self.create_dist()\r
-        cmd = check(dist)\r
-\r
-        # let's see if it detects broken rest\r
-        broken_rest = 'title\n===\n\ntest'\r
-        msgs = cmd._check_rst_data(broken_rest)\r
-        self.assertEqual(len(msgs), 1)\r
-\r
-        # and non-broken rest\r
-        rest = 'title\n=====\n\ntest'\r
-        msgs = cmd._check_rst_data(rest)\r
-        self.assertEqual(len(msgs), 0)\r
-\r
-    def test_check_restructuredtext(self):\r
-        if not HAS_DOCUTILS: # won't test without docutils\r
-            return\r
-        # let's see if it detects broken rest in long_description\r
-        broken_rest = 'title\n===\n\ntest'\r
-        pkg_info, dist = self.create_dist(long_description=broken_rest)\r
-        cmd = check(dist)\r
-        cmd.check_restructuredtext()\r
-        self.assertEqual(cmd._warnings, 1)\r
-\r
-        # let's see if we have an error with strict=1\r
-        metadata = {'url': 'xxx', 'author': 'xxx',\r
-                    'author_email': 'xxx',\r
-                    'name': 'xxx', 'version': 'xxx',\r
-                    'long_description': broken_rest}\r
-        self.assertRaises(DistutilsSetupError, self._run, metadata,\r
-                          **{'strict': 1, 'restructuredtext': 1})\r
-\r
-        # and non-broken rest\r
-        metadata['long_description'] = 'title\n=====\n\ntest'\r
-        cmd = self._run(metadata, strict=1, restructuredtext=1)\r
-        self.assertEqual(cmd._warnings, 0)\r
-\r
-    def test_check_all(self):\r
-\r
-        metadata = {'url': 'xxx', 'author': 'xxx'}\r
-        self.assertRaises(DistutilsSetupError, self._run,\r
-                          {}, **{'strict': 1,\r
-                                 'restructuredtext': 1})\r
-\r
-def test_suite():\r
-    return unittest.makeSuite(CheckTestCase)\r
-\r
-if __name__ == "__main__":\r
-    run_unittest(test_suite())\r