MCPcopy
hub / github.com/rclone/rclone / TestCopyWithDryRun

Function TestCopyWithDryRun

fs/sync/sync_test.go:49–64  ·  view source on GitHub ↗

Check dry run is working

(t *testing.T)

Source from the content-addressed store, hash-verified

47
48// Check dry run is working
49func TestCopyWithDryRun(t *testing.T) {
50 ctx := context.Background()
51 ctx, ci := fs.AddConfig(ctx)
52 r := fstest.NewRun(t)
53 file1 := r.WriteFile("sub dir/hello world", "hello world", t1)
54 r.Mkdir(ctx, r.Fremote)
55
56 ci.DryRun = true
57 ctx = predictDstFromLogger(ctx)
58 err := CopyDir(ctx, r.Fremote, r.Flocal, false)
59 testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t) // error expected here because dry-run
60 require.NoError(t, err)
61
62 r.CheckLocalItems(t, file1)
63 r.CheckRemoteItems(t)
64}
65
66// Now without dry run
67func TestCopy(t *testing.T) {

Callers

nothing calls this directly

Calls 10

WriteFileMethod · 0.95
MkdirMethod · 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…