summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index bf0e196..1c87d06 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -223,6 +223,23 @@ class StatAttributeTests(unittest.TestCase):
except TypeError:
pass
+ def test_utime_dir(self):
+ delta = 1000000
+ st = os.stat(test_support.TESTFN)
+ # round to int, because some systems may support sub-second
+ # time stamps in stat, but not in utime.
+ os.utime(test_support.TESTFN, (st.st_atime, int(st.st_mtime-delta)))
+ st2 = os.stat(test_support.TESTFN)
+ self.assertEquals(st2.st_mtime, int(st.st_mtime-delta))
+
+ # 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)
+
from test import mapping_tests
class EnvironTests(mapping_tests.BasicTestMappingProtocol):