diff options
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test__locale.py | 4 | ||||
| -rw-r--r-- | Lib/test/test_platform.py | 8 |
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') |
