MCPcopy
hub / github.com/rclone/rclone / TestServerSideMoveLocal

Function TestServerSideMoveLocal

fs/sync/sync_test.go:1793–1806  ·  view source on GitHub ↗

Test MoveDir on Local

(t *testing.T)

Source from the content-addressed store, hash-verified

1791
1792// Test MoveDir on Local
1793func TestServerSideMoveLocal(t *testing.T) {
1794 ctx := context.Background()
1795 r := fstest.NewRun(t)
1796 f1 := r.WriteFile("dir1/file1.txt", "hello", t1)
1797 f2 := r.WriteFile("dir2/file2.txt", "hello again", t2)
1798 r.CheckLocalItems(t, f1, f2)
1799
1800 dir1, err := fs.NewFs(ctx, r.Flocal.Root()+"/dir1")
1801 require.NoError(t, err)
1802 dir2, err := fs.NewFs(ctx, r.Flocal.Root()+"/dir2")
1803 require.NoError(t, err)
1804 err = MoveDir(ctx, dir2, dir1, false, false)
1805 require.NoError(t, err)
1806}
1807
1808// Test move
1809func TestMoveWithDeleteEmptySrcDirs(t *testing.T) {

Callers

nothing calls this directly

Calls 6

WriteFileMethod · 0.95
CheckLocalItemsMethod · 0.95
NewRunFunction · 0.92
NewFsFunction · 0.92
MoveDirFunction · 0.85
RootMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…