diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2007-08-30 19:04:09 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2007-08-30 19:04:09 (GMT) |
commit | 7dcb83cdc5b7aae31db3dcb080c50939bff5460d (patch) | |
tree | ca1f515f08a2d3625ddcbef7a74df9bcd265a341 /Lib/test/test_os.py | |
parent | 75c23bddbec1fbb2ae1d615f4a38db74095f387f (diff) | |
download | cpython-7dcb83cdc5b7aae31db3dcb080c50939bff5460d.zip cpython-7dcb83cdc5b7aae31db3dcb080c50939bff5460d.tar.gz cpython-7dcb83cdc5b7aae31db3dcb080c50939bff5460d.tar.bz2 |
Bug #1709599: Run test_1565150 only if the file system is NTFS.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r-- | Lib/test/test_os.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index a9294c0..52fdd8a 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -235,10 +235,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 |