]> granicus.if.org Git - python/commitdiff
Bug #1709599: Run test_1565150 only if the file system is NTFS.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 30 Aug 2007 18:58:29 +0000 (18:58 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 30 Aug 2007 18:58:29 +0000 (18:58 +0000)
Lib/test/test_os.py
Misc/NEWS

index 69e456c1b3a6131fc74877b9e821e8ae37536e6f..34cd3c9b2c58517709ab10c0557a1357d765390e 100644 (file)
@@ -226,10 +226,20 @@ class StatAttributeTests(unittest.TestCase):
     # Restrict test to Win32, since there is no guarantee other
     # systems support centiseconds
     if sys.platform == 'win32':
-        def test_1565150(self):
-            t1 = 1159195039.25
-            os.utime(self.fname, (t1, t1))
-            self.assertEquals(os.stat(self.fname).st_mtime, t1)
+        def get_file_system(path):
+            import os
+            root = os.path.splitdrive(os.path.realpath("."))[0] + '\\'
+            import ctypes
+            kernel32 = ctypes.windll.kernel32
+            buf = ctypes.create_string_buffer("", 100)
+            if kernel32.GetVolumeInformationA(root, None, 0, None, None, None, buf, len(buf)):
+                return buf.value
+
+        if get_file_system(test_support.TESTFN) == "NTFS":
+            def test_1565150(self):
+                t1 = 1159195039.25
+                os.utime(self.fname, (t1, t1))
+                self.assertEquals(os.stat(self.fname).st_mtime, t1)
 
         def test_1686475(self):
             # Verify that an open file can be stat'ed
index 9a0cab0f2c69b6ded446eac49db9f13b619ff859..59378ca014a66e64139a44fef689c5d2a616bc1b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -26,6 +26,8 @@ Core and builtins
 Library
 -------
 
+- Bug #1709599: Run test_1565150 only if the file system is NTFS.
+
 - When encountering a password-protected robots.txt file the RobotFileParser
   no longer prompts interactively for a username and password (bug 813986).