MCPcopy
hub / github.com/rclone/rclone / TestCopyWithDepth

Function TestCopyWithDepth

fs/sync/sync_test.go:288–305  ·  view source on GitHub ↗

Test copy with depth

(t *testing.T)

Source from the content-addressed store, hash-verified

286
287// Test copy with depth
288func TestCopyWithDepth(t *testing.T) {
289 ctx := context.Background()
290 ctx, ci := fs.AddConfig(ctx)
291 r := fstest.NewRun(t)
292 file1 := r.WriteFile("sub dir/hello world", "hello world", t1)
293 file2 := r.WriteFile("hello world2", "hello world2", t2)
294
295 // Check the MaxDepth too
296 ci.MaxDepth = 1
297
298 ctx = predictDstFromLogger(ctx)
299 err := CopyDir(ctx, r.Fremote, r.Flocal, false)
300 require.NoError(t, err)
301 testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t)
302
303 r.CheckLocalItems(t, file1, file2)
304 r.CheckRemoteItems(t, file2)
305}
306
307// Test copy with files from
308func testCopyWithFilesFrom(t *testing.T, noTraverse bool) {

Callers

nothing calls this directly

Calls 9

WriteFileMethod · 0.95
CheckLocalItemsMethod · 0.95
CheckRemoteItemsMethod · 0.95
AddConfigFunction · 0.92
NewRunFunction · 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…