mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Merged revisions 70518,70521,70590,70594-70595 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r70518 | matthias.klose | 2009-03-22 08:08:22 -0500 (Sun, 22 Mar 2009) | 2 lines - Fix comment macro in python.man ........ r70521 | benjamin.peterson | 2009-03-22 12:45:11 -0500 (Sun, 22 Mar 2009) | 1 line close the file even if an exception occurs #5536 ........ r70590 | skip.montanaro | 2009-03-24 19:52:11 -0500 (Tue, 24 Mar 2009) | 1 line clarify the type of data returned ........ r70594 | marc-andre.lemburg | 2009-03-25 14:44:58 -0500 (Wed, 25 Mar 2009) | 9 lines 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. ........ r70595 | marc-andre.lemburg | 2009-03-25 14:45:33 -0500 (Wed, 25 Mar 2009) | 3 lines News item for the platform.py fix (r70594). ........
This commit is contained in:
parent
b476d59792
commit
5f28b7b797
4 changed files with 74 additions and 65 deletions
|
@ -25,40 +25,49 @@ 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_system(self):
|
||||
res = platform.system()
|
||||
|
||||
def test_node(self):
|
||||
res = platform.node()
|
||||
|
||||
def test_release(self):
|
||||
res = platform.release()
|
||||
|
||||
def test_version(self):
|
||||
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_python_branch(self):
|
||||
res = platform.python_branch()
|
||||
|
||||
def test_python_revision(self):
|
||||
res = platform.python_revision()
|
||||
|
||||
def test_python_build(self):
|
||||
res = platform.python_build()
|
||||
|
||||
def test_python_compiler(self):
|
||||
res = platform.python_compiler()
|
||||
|
||||
def test_version(self):
|
||||
res1 = platform.version()
|
||||
res2 = platform.version_tuple()
|
||||
self.assertEqual(res1, ".".join(res2))
|
||||
|
||||
def test_release(self):
|
||||
res = platform.release()
|
||||
|
||||
def test_system(self):
|
||||
res = platform.system()
|
||||
|
||||
def test_version(self):
|
||||
res = platform.version()
|
||||
|
||||
def test_system_alias(self):
|
||||
res = platform.system_alias(
|
||||
platform.system(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue