MCPcopy
hub / github.com/rclone/rclone / TestMove

Function TestMove

fs/sync/sync_transform_test.go:396–413  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

394}
395
396func TestMove(t *testing.T) {
397 ctx := context.Background()
398 r := fstest.NewRun(t)
399 err := transform.SetOptions(ctx, "all,prefix=tac", "all,prefix=tic")
400 require.NoError(t, err)
401 r.WriteFile("toe/toe/toe.txt", "hello world", t1)
402 _, err = operations.MkdirModTime(ctx, r.Flocal, "empty_dir", t1)
403 require.NoError(t, err)
404
405 r.Mkdir(ctx, r.Fremote)
406 ctx = predictDstFromLogger(ctx)
407 err = MoveDir(ctx, r.Fremote, r.Flocal, true, true)
408 testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t)
409 require.NoError(t, err)
410
411 r.CheckLocalListing(t, []fstest.Item{}, []string{})
412 r.CheckRemoteListing(t, []fstest.Item{fstest.NewItem("tictactoe/tictactoe/tictactoe.txt", "hello world", t1)}, []string{"tictacempty_dir", "tictactoe", "tictactoe/tictactoe"})
413}
414
415func TestTransformFile(t *testing.T) {
416 ctx := context.Background()

Callers

nothing calls this directly

Calls 12

WriteFileMethod · 0.95
MkdirMethod · 0.95
CheckLocalListingMethod · 0.95
CheckRemoteListingMethod · 0.95
NewRunFunction · 0.92
SetOptionsFunction · 0.92
MkdirModTimeFunction · 0.92
GetLoggerOptFunction · 0.92
NewItemFunction · 0.92
predictDstFromLoggerFunction · 0.85
MoveDirFunction · 0.85
testLoggerVsLsfFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…