diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-03-26 18:58:30 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-03-26 18:58:30 (GMT) |
commit | 94e4e2a7e583471627d76a2f3b2886c9064b7420 (patch) | |
tree | 1e7759700e45ddeeb4547ab06482c4b1b58c5363 /Lib/test/test_platform.py | |
parent | b457b89323e3110159298bb5aa149f56733aaef8 (diff) | |
download | cpython-94e4e2a7e583471627d76a2f3b2886c9064b7420.zip cpython-94e4e2a7e583471627d76a2f3b2886c9064b7420.tar.gz cpython-94e4e2a7e583471627d76a2f3b2886c9064b7420.tar.bz2 |
roll old test in with new one
Diffstat (limited to 'Lib/test/test_platform.py')
-rw-r--r-- | Lib/test/test_platform.py | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index dc490ce..f10aa06 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -58,7 +58,23 @@ class PlatformTest(unittest.TestCase): sys.subversion = self.save_subversion sys.platform = self.save_platform - def test_python_info(self): + def test_sys_version(self): + # Old test. + for input, output in ( + ('2.4.3 (#1, Jun 21 2006, 13:54:21) \n[GCC 3.3.4 (pre 3.3.5 20040809)]', + ('CPython', '2.4.3', '', '', '1', 'Jun 21 2006 13:54:21', 'GCC 3.3.4 (pre 3.3.5 20040809)')), + ('IronPython 1.0.60816 on .NET 2.0.50727.42', + ('IronPython', '1.0.60816', '', '', '', '', '.NET 2.0.50727.42')), + ('IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42', + ('IronPython', '1.0.0', '', '', '', '', '.NET 2.0.50727.42')), + ): + # branch and revision are not "parsed", but fetched + # from sys.subversion. Ignore them + (name, version, branch, revision, buildno, builddate, compiler) \ + = platform._sys_version(input) + self.assertEqual( + (name, version, '', '', buildno, builddate, compiler), output) + # Tests for python_implementation(), python_version(), python_branch(), # python_revision(), python_build(), and python_compiler(). sys_versions = { @@ -174,23 +190,6 @@ class PlatformTest(unittest.TestCase): ): self.assertEqual(platform._parse_release_file(input), output) - def test_sys_version(self): - - platform._sys_version_cache.clear() - for input, output in ( - ('2.4.3 (#1, Jun 21 2006, 13:54:21) \n[GCC 3.3.4 (pre 3.3.5 20040809)]', - ('CPython', '2.4.3', '', '', '1', 'Jun 21 2006 13:54:21', 'GCC 3.3.4 (pre 3.3.5 20040809)')), - ('IronPython 1.0.60816 on .NET 2.0.50727.42', - ('IronPython', '1.0.60816', '', '', '', '', '.NET 2.0.50727.42')), - ('IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42', - ('IronPython', '1.0.0', '', '', '', '', '.NET 2.0.50727.42')), - ): - # branch and revision are not "parsed", but fetched - # from sys.subversion. Ignore them - (name, version, branch, revision, buildno, builddate, compiler) \ - = platform._sys_version(input) - self.assertEqual( - (name, version, '', '', buildno, builddate, compiler), output) def test_main(): test_support.run_unittest( |