MCPcopy
hub / github.com/rclone/rclone / TestDirRemoveAll

Function TestDirRemoveAll

vfs/dir_test.go:476–495  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

474}
475
476func TestDirRemoveAll(t *testing.T) {
477 r, vfs, dir, _ := dirCreate(t)
478
479 // Remove the directory and contents
480 err := dir.RemoveAll()
481 require.NoError(t, err)
482
483 // check the vfs
484 root, err := vfs.Root()
485 require.NoError(t, err)
486 checkListing(t, root, []string(nil))
487
488 // check the underlying r.Fremote
489 fstest.CheckListingWithPrecision(t, r.Fremote, []fstest.Item{}, []string{}, r.Fremote.Precision())
490
491 // read only check
492 vfs.Opt.ReadOnly = true
493 err = dir.RemoveAll()
494 assert.Equal(t, EROFS, err)
495}
496
497func TestDirRemoveName(t *testing.T) {
498 r, vfs, dir, _ := dirCreate(t)

Callers

nothing calls this directly

Calls 7

dirCreateFunction · 0.85
checkListingFunction · 0.70
RemoveAllMethod · 0.65
RootMethod · 0.65
PrecisionMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…