[Python-checkins] r63348 - python/trunk/Lib/test/test_platform.py

benjamin.peterson python-checkins at python.org
Fri May 16 04:24:50 CEST 2008


Author: benjamin.peterson
Date: Fri May 16 04:24:49 2008
New Revision: 63348

Log:
make test_platform a bit more assertive (We'll see what the buildbots say.)


Modified:
   python/trunk/Lib/test/test_platform.py

Modified: python/trunk/Lib/test/test_platform.py
==============================================================================
--- python/trunk/Lib/test/test_platform.py	(original)
+++ python/trunk/Lib/test/test_platform.py	Fri May 16 04:24:49 2008
@@ -1,7 +1,9 @@
+import sys
 import unittest
-from test import test_support
 import platform
 
+from test import test_support
+
 class PlatformTest(unittest.TestCase):
     def test_architecture(self):
         res = platform.architecture()
@@ -49,26 +51,35 @@
 
     def test_uname(self):
         res = platform.uname()
+        self.assert_(any(res))
 
     def test_java_ver(self):
         res = platform.java_ver()
+        if sys.platform == 'java':
+            self.assert_(all(res))
 
     def test_win32_ver(self):
         res = platform.win32_ver()
 
     def test_mac_ver(self):
         res = platform.mac_ver()
+        try:
+            import gestalt
+        except ImportError: pass
+        else:
+            if sys.platform == 'darwin':
+                self.assert_(all(res))
 
     def test_dist(self):
         res = platform.dist()
 
     def test_libc_ver(self):
-        from sys import executable
         import os
-        if os.path.isdir(executable) and os.path.exists(executable+'.exe'):
+        if os.path.isdir(sys.executable) and \
+           os.path.exists(sys.executable+'.exe'):
             # Cygwin horror
             executable = executable + '.exe'
-        res = platform.libc_ver(executable)
+        res = platform.libc_ver(sys.executable)
 
 def test_main():
     test_support.run_unittest(


More information about the Python-checkins mailing list