diff options
author | Larry Hastings <larry@hastings.org> | 2012-04-19 22:07:49 (GMT) |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2012-04-19 22:07:49 (GMT) |
commit | 6fe20b3aee076850e390ef8bb2078b1cd09ddf88 (patch) | |
tree | 235f93dbd1d92f3983b6e4a4f1d84db296420365 /Lib/test | |
parent | dd5aa36f179011f390a0cc6fb4ba7bba1764f1a9 (diff) | |
download | cpython-6fe20b3aee076850e390ef8bb2078b1cd09ddf88.zip cpython-6fe20b3aee076850e390ef8bb2078b1cd09ddf88.tar.gz cpython-6fe20b3aee076850e390ef8bb2078b1cd09ddf88.tar.bz2 |
Issue #14127: Add st_{cma}time_ns fields to os.stat() result object.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_os.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index b85d97d..aa619a8 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -191,6 +191,13 @@ class StatAttributeTests(unittest.TestCase): result[getattr(stat, name)]) self.assertIn(attr, members) + # Make sure that the st_?time and st_?time_ns fields roughly agree + # (they should always agree up to the tens-of-microseconds magnitude) + for name in 'st_atime st_mtime st_ctime'.split(): + floaty = int(getattr(result, name) * 100000) + nanosecondy = getattr(result, name + "_ns") // 10000 + self.assertEqual(floaty, nanosecondy) + try: result[200] self.fail("No exception thrown") |