summaryrefslogtreecommitdiff
path: root/test-sftpfs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-11-26 09:05:12 +0000
committerLars Wirzenius <liw@liw.fi>2011-11-26 09:05:12 +0000
commitcf26bd419e46c3e5edeb5f5ebe45936f47c921c6 (patch)
tree9425d95e0c65379cc13c8ab94f8e4771c08fe2c2 /test-sftpfs
parenteaab04cb1e4794f2611ba2b2db542eb2705d4849 (diff)
downloadobnam-cf26bd419e46c3e5edeb5f5ebe45936f47c921c6.tar.gz
Use split time fields in SFTP
Diffstat (limited to 'test-sftpfs')
-rwxr-xr-xtest-sftpfs10
1 files changed, 10 insertions, 0 deletions
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__':