MCPcopy
hub / github.com/rclone/rclone / TestCopyFileBackupDir

Function TestCopyFileBackupDir

fs/operations/copy_test.go:169–190  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

167}
168
169func TestCopyFileBackupDir(t *testing.T) {
170 ctx := context.Background()
171 ctx, ci := fs.AddConfig(ctx)
172 r := fstest.NewRun(t)
173 if !operations.CanServerSideMove(r.Fremote) {
174 t.Skip("Skipping test as remote does not support server-side move or copy")
175 }
176
177 ci.BackupDir = r.FremoteName + "/backup"
178
179 file1 := r.WriteFile("dst/file1", "file1 contents", t1)
180 r.CheckLocalItems(t, file1)
181
182 file1old := r.WriteObject(ctx, "dst/file1", "file1 contents old", t1)
183 r.CheckRemoteItems(t, file1old)
184
185 err := operations.CopyFile(ctx, r.Fremote, r.Flocal, file1.Path, file1.Path)
186 require.NoError(t, err)
187 r.CheckLocalItems(t, file1)
188 file1old.Path = "backup/dst/file1"
189 r.CheckRemoteItems(t, file1old, file1)
190}
191
192// Test with CompareDest set
193func TestCopyFileCompareDest(t *testing.T) {

Callers

nothing calls this directly

Calls 8

WriteFileMethod · 0.95
CheckLocalItemsMethod · 0.95
WriteObjectMethod · 0.95
CheckRemoteItemsMethod · 0.95
AddConfigFunction · 0.92
NewRunFunction · 0.92
CanServerSideMoveFunction · 0.92
CopyFileFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…