From cf26bd419e46c3e5edeb5f5ebe45936f47c921c6 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 26 Nov 2011 09:05:12 +0000 Subject: Use split time fields in SFTP --- test-sftpfs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test-sftpfs') diff --git a/test-sftpfs b/test-sftpfs index c8632ad3..4d7e626b 100755 --- a/test-sftpfs +++ b/test-sftpfs @@ -58,6 +58,16 @@ class SftpTests(unittest.TestCase, obnamlib.VfsTests): def test_mknod_creates_fifo(self): self.assertRaises(NotImplementedError, self.fs.mknod, 'foo', 0) + + # Override method from the VfsTests class. SFTP doesn't do sub-second + # timestamps, so we fix the test here to not set those fields to nonzero. + def test_lutimes_sets_times_correctly(self): + self.fs.mkdir('foo') + self.fs.lutimes('foo', 1, 2*1000, 3, 4*1000) + self.assertEqual(self.fs.lstat('foo').st_atime_sec, 1) + self.assertEqual(self.fs.lstat('foo').st_atime_nsec, 0) + self.assertEqual(self.fs.lstat('foo').st_mtime_sec, 3) + self.assertEqual(self.fs.lstat('foo').st_mtime_nsec, 0) if __name__ == '__main__': -- cgit v1.2.1