MCPcopy Index your code
hub / github.com/rclone/rclone / TestCopy

Function TestCopy

fs/sync/sync_test.go:67–87  ·  view source on GitHub ↗

Now without dry run

(t *testing.T)

Source from the content-addressed store, hash-verified

65
66// Now without dry run
67func TestCopy(t *testing.T) {
68 ctx := context.Background()
69 r := fstest.NewRun(t)
70 file1 := r.WriteFile("sub dir/hello world", "hello world", t1)
71 _, err := operations.SetDirModTime(ctx, r.Flocal, nil, "sub dir", t2)
72 if err != nil && !errors.Is(err, fs.ErrorNotImplemented) {
73 require.NoError(t, err)
74 }
75 r.Mkdir(ctx, r.Fremote)
76
77 ctx = predictDstFromLogger(ctx)
78 err = CopyDir(ctx, r.Fremote, r.Flocal, false)
79 require.NoError(t, err)
80 testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t)
81
82 r.CheckLocalItems(t, file1)
83 r.CheckRemoteItems(t, file1)
84
85 // Check that the modtimes of the directories are as expected
86 r.CheckDirectoryModTimes(t, "sub dir")
87}
88
89func testCopyMetadata(t *testing.T, createEmptySrcDirs bool) {
90 ctx := context.Background()

Callers

nothing calls this directly

Calls 12

WriteFileMethod · 0.95
MkdirMethod · 0.95
CheckLocalItemsMethod · 0.95
CheckRemoteItemsMethod · 0.95
NewRunFunction · 0.92
SetDirModTimeFunction · 0.92
GetLoggerOptFunction · 0.92
predictDstFromLoggerFunction · 0.85
testLoggerVsLsfFunction · 0.85
IsMethod · 0.80
CopyDirFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…