diff options
-rw-r--r-- | test/metadata.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/metadata.py b/test/metadata.py index 7abcb6e..1b098b1 100644 --- a/test/metadata.py +++ b/test/metadata.py @@ -94,39 +94,39 @@ class TestImageMetadata(unittest.TestCase): def test_write_preserve_timestamps(self): stat = os.stat(self.pathname) - atime = stat.st_atime - mtime = stat.st_mtime + atime = round(stat.st_atime) + mtime = round(stat.st_mtime) metadata = ImageMetadata(self.pathname) metadata.read() metadata.comment = 'Yellow Submarine' time.sleep(1.1) metadata.write(preserve_timestamps=True) stat2 = os.stat(self.pathname) - atime2 = stat2.st_atime - mtime2 = stat2.st_atime + atime2 = round(stat2.st_atime) + mtime2 = round(stat2.st_atime) self.failUnlessEqual(atime2, atime) self.failUnlessEqual(mtime2, mtime) def test_write_dont_preserve_timestamps(self): stat = os.stat(self.pathname) - atime = stat.st_atime - mtime = stat.st_mtime + atime = round(stat.st_atime) + mtime = round(stat.st_mtime) metadata = ImageMetadata(self.pathname) metadata.read() metadata.comment = 'Yellow Submarine' time.sleep(1.1) metadata.write() stat2 = os.stat(self.pathname) - atime2 = stat2.st_atime - mtime2 = stat2.st_atime + atime2 = round(stat2.st_atime) + mtime2 = round(stat2.st_atime) self.failIfEqual(atime2, atime) self.failIfEqual(mtime2, mtime) metadata.comment = 'Yesterday' time.sleep(1.1) metadata.write(preserve_timestamps=True) stat3 = os.stat(self.pathname) - atime3 = stat3.st_atime - mtime3 = stat3.st_atime + atime3 = round(stat3.st_atime) + mtime3 = round(stat3.st_atime) self.failUnlessEqual(atime3, atime2) self.failUnlessEqual(mtime3, mtime2) |