MCPcopy
hub / github.com/rclone/rclone / TestCopyAfterDelete

Function TestCopyAfterDelete

fs/sync/sync_test.go:734–751  ·  view source on GitHub ↗

Check that if the local file doesn't exist when we copy it up, nothing happens to the remote file

(t *testing.T)

Source from the content-addressed store, hash-verified

732// Check that if the local file doesn't exist when we copy it up,
733// nothing happens to the remote file
734func TestCopyAfterDelete(t *testing.T) {
735 ctx := context.Background()
736 r := fstest.NewRun(t)
737 file1 := r.WriteObject(ctx, "sub dir/hello world", "hello world", t1)
738 r.CheckLocalItems(t)
739 r.CheckRemoteItems(t, file1)
740
741 err := operations.Mkdir(ctx, r.Flocal, "")
742 require.NoError(t, err)
743
744 ctx = predictDstFromLogger(ctx)
745 err = CopyDir(ctx, r.Fremote, r.Flocal, false)
746 require.NoError(t, err)
747 testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t)
748
749 r.CheckLocalItems(t)
750 r.CheckRemoteItems(t, file1)
751}
752
753// Check the copy downloading a file
754func TestCopyRedownload(t *testing.T) {

Callers

nothing calls this directly

Calls 9

WriteObjectMethod · 0.95
CheckLocalItemsMethod · 0.95
CheckRemoteItemsMethod · 0.95
NewRunFunction · 0.92
MkdirFunction · 0.92
GetLoggerOptFunction · 0.92
predictDstFromLoggerFunction · 0.85
testLoggerVsLsfFunction · 0.85
CopyDirFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…