1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-03 09:03:50 +00:00

implement ModTime via FUSE for remotes that support it (fixes #1197)

This commit is contained in:
Stefan Breunig
2017-03-23 20:41:21 +01:00
committed by Stefan Breunig
parent 216499d78b
commit 4dc030d081
5 changed files with 112 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import (
"io/ioutil"
"os"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -133,3 +134,20 @@ func TestDirRenameFullDir(t *testing.T) {
run.rmdir(t, "dir")
run.checkDir(t, "")
}
func TestDirModTime(t *testing.T) {
run.skipIfNoFUSE(t)
run.mkdir(t, "dir")
mtime := time.Date(2012, 11, 18, 17, 32, 31, 0, time.UTC)
err := os.Chtimes(run.path("dir"), mtime, mtime)
require.NoError(t, err)
info, err := os.Stat(run.path("dir"))
require.NoError(t, err)
// avoid errors because of timezone differences
assert.Equal(t, info.ModTime().Unix(), mtime.Unix())
run.rmdir(t, "dir")
}