1
0
mirror of https://github.com/rclone/rclone.git synced 2025-11-23 21:44:49 +02:00

move: delete source directory after successful move - fixes #1642

This commit is contained in:
ishuah
2017-11-06 19:18:13 +03:00
committed by Nick Craig-Wood
parent 8c8abfd6dc
commit c65734ee69
3 changed files with 37 additions and 2 deletions

View File

@@ -262,6 +262,7 @@ func CheckListingWithPrecision(t *testing.T, f fs.Fs, items []Item, expectedDirs
if err != nil && err != fs.ErrorDirNotFound {
t.Fatalf("Error listing: %v", err)
}
gotListing = makeListingFromObjects(objs)
listingOK = wantListing1 == gotListing || wantListing2 == gotListing
if listingOK && (expectedDirs == nil || len(dirs) == len(expectedDirs)) {
@@ -320,6 +321,16 @@ func CheckItems(t *testing.T, f fs.Fs, items ...Item) {
CheckListingWithPrecision(t, f, items, nil, fs.Config.ModifyWindow)
}
// CheckRootDir checks the fs to see if the root dir exists or not
func CheckRootDir(t *testing.T, f fs.Fs, shouldExist bool) {
_, _, err := fs.WalkGetAll(f, "", true, -1)
if shouldExist {
require.NoError(t, err)
} else {
assert.EqualError(t, err, fs.ErrorDirNotFound.Error())
}
}
// Time parses a time string or logs a fatal error
func Time(timeString string) time.Time {
t, err := time.Parse(time.RFC3339Nano, timeString)