MCPcopy
hub / github.com/rclone/rclone / TestMoveFileWithIgnoreExisting

Function TestMoveFileWithIgnoreExisting

fs/operations/operations_test.go:981–1004  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

979}
980
981func TestMoveFileWithIgnoreExisting(t *testing.T) {
982 ctx := context.Background()
983 ctx, ci := fs.AddConfig(ctx)
984 r := fstest.NewRun(t)
985 file1 := r.WriteFile("file1", "file1 contents", t1)
986 r.CheckLocalItems(t, file1)
987
988 ci.IgnoreExisting = true
989
990 err := operations.MoveFile(ctx, r.Fremote, r.Flocal, file1.Path, file1.Path)
991 require.NoError(t, err)
992 r.CheckLocalItems(t)
993 r.CheckRemoteItems(t, file1)
994
995 // Recreate file with updated content
996 file1b := r.WriteFile("file1", "file1 modified", t2)
997 r.CheckLocalItems(t, file1b)
998
999 // Ensure modified file did not transfer and was not deleted
1000 err = operations.MoveFile(ctx, r.Fremote, r.Flocal, file1.Path, file1b.Path)
1001 require.NoError(t, err)
1002 r.CheckLocalItems(t, file1b)
1003 r.CheckRemoteItems(t, file1)
1004}
1005
1006func TestCaseInsensitiveMoveFile(t *testing.T) {
1007 ctx := context.Background()

Callers

nothing calls this directly

Calls 6

WriteFileMethod · 0.95
CheckLocalItemsMethod · 0.95
CheckRemoteItemsMethod · 0.95
AddConfigFunction · 0.92
NewRunFunction · 0.92
MoveFileFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…