summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2012-06-24 14:30:41 -0700
committerLarry Hastings <larry@hastings.org>2012-06-24 14:30:41 -0700
commit68386bc0b88eb4b7c9aeb4f753114dc85f8df5b6 (patch)
tree051c2a77f319435a45f398049806b6fd2e09408b /Lib/test
parent56ed2844fa88882a91f9ccf670c0e7a9736eb2a2 (diff)
downloadcpython-git-68386bc0b88eb4b7c9aeb4f753114dc85f8df5b6.tar.gz
Issue #15164: Change return value of platform.uname() from a
plain tuple to a collections.namedtuple.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test__locale.py4
-rw-r--r--Lib/test/test_platform.py8
2 files changed, 9 insertions, 3 deletions
diff --git a/Lib/test/test__locale.py b/Lib/test/test__locale.py
index f7f1abdab2..4231f37bc9 100644
--- a/Lib/test/test__locale.py
+++ b/Lib/test/test__locale.py
@@ -11,8 +11,8 @@ import unittest
from platform import uname
from test.support import run_unittest
-if uname()[0] == "Darwin":
- maj, min, mic = [int(part) for part in uname()[2].split(".")]
+if uname().system == "Darwin":
+ maj, min, mic = [int(part) for part in uname().release.split(".")]
if (maj, min, mic) < (8, 0, 0):
raise unittest.SkipTest("locale support broken for OS X < 10.4")
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
index cfe623a867..6abf44342a 100644
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -133,6 +133,12 @@ class PlatformTest(unittest.TestCase):
def test_uname(self):
res = platform.uname()
self.assertTrue(any(res))
+ self.assertEqual(res[0], res.system)
+ self.assertEqual(res[1], res.node)
+ self.assertEqual(res[2], res.release)
+ self.assertEqual(res[3], res.version)
+ self.assertEqual(res[4], res.machine)
+ self.assertEqual(res[5], res.processor)
@unittest.skipUnless(sys.platform.startswith('win'), "windows only test")
def test_uname_win32_ARCHITEW6432(self):
@@ -166,7 +172,7 @@ class PlatformTest(unittest.TestCase):
def test_mac_ver(self):
res = platform.mac_ver()
- if platform.uname()[0] == 'Darwin':
+ if platform.uname().system == 'Darwin':
# We're on a MacOSX system, check that
# the right version information is returned
fd = os.popen('sw_vers', 'r')