1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

sync: fix TestMoveEmptyDirectories so they work on backends which don't support DirModTimes

This commit is contained in:
Nick Craig-Wood
2024-03-01 10:56:48 +00:00
parent 6e28edeb9a
commit be39e99918
3 changed files with 6 additions and 5 deletions

View File

@@ -602,6 +602,10 @@ func CheckEntryMetadata(ctx context.Context, t *testing.T, f fs.Fs, entry fs.Dir
// CheckDirModTime checks the modtime on the directory
func CheckDirModTime(ctx context.Context, t *testing.T, f fs.Fs, dir fs.Directory, wantT time.Time) {
if f.Features().DirSetModTime == nil && f.Features().MkdirMetadata == nil {
fs.Debugf(f, "Skipping modtime test as remote does not support DirSetModTime or MkdirMetadata")
return
}
gotT := dir.ModTime(ctx)
AssertTimeEqualWithPrecision(t, dir.Remote(), wantT, gotT, f.Precision())
}