]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.10/Lib/json/tests/__init__.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / Lib / json / tests / __init__.py
diff --git a/AppPkg/Applications/Python/Python-2.7.10/Lib/json/tests/__init__.py b/AppPkg/Applications/Python/Python-2.7.10/Lib/json/tests/__init__.py
deleted file mode 100644 (file)
index 17d3849..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-import os\r
-import sys\r
-import json\r
-import doctest\r
-import unittest\r
-\r
-from test import test_support\r
-\r
-# import json with and without accelerations\r
-cjson = test_support.import_fresh_module('json', fresh=['_json'])\r
-pyjson = test_support.import_fresh_module('json', blocked=['_json'])\r
-\r
-# create two base classes that will be used by the other tests\r
-class PyTest(unittest.TestCase):\r
-    json = pyjson\r
-    loads = staticmethod(pyjson.loads)\r
-    dumps = staticmethod(pyjson.dumps)\r
-\r
-@unittest.skipUnless(cjson, 'requires _json')\r
-class CTest(unittest.TestCase):\r
-    if cjson is not None:\r
-        json = cjson\r
-        loads = staticmethod(cjson.loads)\r
-        dumps = staticmethod(cjson.dumps)\r
-\r
-# test PyTest and CTest checking if the functions come from the right module\r
-class TestPyTest(PyTest):\r
-    def test_pyjson(self):\r
-        self.assertEqual(self.json.scanner.make_scanner.__module__,\r
-                         'json.scanner')\r
-        self.assertEqual(self.json.decoder.scanstring.__module__,\r
-                         'json.decoder')\r
-        self.assertEqual(self.json.encoder.encode_basestring_ascii.__module__,\r
-                         'json.encoder')\r
-\r
-class TestCTest(CTest):\r
-    def test_cjson(self):\r
-        self.assertEqual(self.json.scanner.make_scanner.__module__, '_json')\r
-        self.assertEqual(self.json.decoder.scanstring.__module__, '_json')\r
-        self.assertEqual(self.json.encoder.c_make_encoder.__module__, '_json')\r
-        self.assertEqual(self.json.encoder.encode_basestring_ascii.__module__,\r
-                         '_json')\r
-\r
-\r
-here = os.path.dirname(__file__)\r
-\r
-def test_suite():\r
-    suite = additional_tests()\r
-    loader = unittest.TestLoader()\r
-    for fn in os.listdir(here):\r
-        if fn.startswith("test") and fn.endswith(".py"):\r
-            modname = "json.tests." + fn[:-3]\r
-            __import__(modname)\r
-            module = sys.modules[modname]\r
-            suite.addTests(loader.loadTestsFromModule(module))\r
-    return suite\r
-\r
-def additional_tests():\r
-    suite = unittest.TestSuite()\r
-    for mod in (json, json.encoder, json.decoder):\r
-        suite.addTest(doctest.DocTestSuite(mod))\r
-    suite.addTest(TestPyTest('test_pyjson'))\r
-    suite.addTest(TestCTest('test_cjson'))\r
-    return suite\r
-\r
-def main():\r
-    suite = test_suite()\r
-    runner = unittest.TextTestRunner()\r
-    runner.run(suite)\r
-\r
-if __name__ == '__main__':\r
-    sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))\r
-    main()\r