summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_platform.py
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2009-03-25 19:44:58 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2009-03-25 19:44:58 (GMT)
commita519cfc9534016725435c23fc1840d7d43d47c3b (patch)
tree4deadf1b93bf2844bb78c8baa6b5571c42b32d02 /Lib/test/test_platform.py
parent9a1337b95e488a46caa781853591c20fd1de3be9 (diff)
downloadcpython-a519cfc9534016725435c23fc1840d7d43d47c3b.zip
cpython-a519cfc9534016725435c23fc1840d7d43d47c3b.tar.gz
cpython-a519cfc9534016725435c23fc1840d7d43d47c3b.tar.bz2
Remove the sys.version_info shortcut, since they cause the APIs
to return different information than the _sys_version() output used in previous Python versions. This also fixes issue5561: platform.python_version_tuple returns tuple of ints, should be strings Added more tests for the various platform functions.
Diffstat (limited to 'Lib/test/test_platform.py')
-rw-r--r--Lib/test/test_platform.py49
1 files changed, 29 insertions, 20 deletions
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
index e6a1dea..cc1a0a9 100644
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -25,39 +25,48 @@ class PlatformTest(unittest.TestCase):
finally:
os.remove(link)
- def test_machine(self):
- res = platform.machine()
-
- def test_node(self):
- res = platform.node()
-
def test_platform(self):
for aliased in (False, True):
for terse in (False, True):
res = platform.platform(aliased, terse)
- def test_processor(self):
- res = platform.processor()
+ def test_system(self):
+ res = platform.system()
- def test_python_build(self):
- res = platform.python_build()
+ def test_node(self):
+ res = platform.node()
- def test_python_compiler(self):
- res = platform.python_compiler()
+ def test_release(self):
+ res = platform.release()
def test_version(self):
- res1 = platform.version()
- res2 = platform.version_tuple()
+ res = platform.version()
+
+ def test_machine(self):
+ res = platform.machine()
+
+ def test_processor(self):
+ res = platform.processor()
+
+ def test_python_implementation(self):
+ res = platform.python_implementation()
+
+ def test_python_version(self):
+ res1 = platform.python_version()
+ res2 = platform.python_version_tuple()
self.assertEqual(res1, ".".join(res2))
- def test_release(self):
- res = platform.release()
+ def test_python_branch(self):
+ res = platform.python_branch()
- def test_system(self):
- res = platform.system()
+ def test_python_revision(self):
+ res = platform.python_revision()
- def test_version(self):
- res = platform.version()
+ def test_python_build(self):
+ res = platform.python_build()
+
+ def test_python_compiler(self):
+ res = platform.python_compiler()
def test_system_alias(self):
res = platform.system_alias(