MCPcopy
hub / github.com/rclone/rclone / TestDirMkdir

Function TestDirMkdir

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

Source from the content-addressed store, hash-verified

386}
387
388func TestDirMkdir(t *testing.T) {
389 r, vfs, dir, file1 := dirCreate(t)
390
391 _, err := dir.Mkdir("file1")
392 assert.Error(t, err)
393
394 origModTime := dir.ModTime()
395 time.Sleep(100 * time.Millisecond) // for low rez Windows timers
396 sub, err := dir.Mkdir("sub")
397 assert.NoError(t, err)
398 assert.True(t, dir.ModTime().After(origModTime))
399
400 // check the vfs
401 checkListing(t, dir, []string{"file1,14,false", "sub,0,true"})
402 checkListing(t, sub, []string(nil))
403
404 // check the underlying r.Fremote
405 fstest.CheckListingWithPrecision(t, r.Fremote, []fstest.Item{file1}, []string{"dir", "dir/sub"}, r.Fremote.Precision())
406
407 vfs.Opt.ReadOnly = true
408 _, err = dir.Mkdir("sausage")
409 assert.Equal(t, EROFS, err)
410}
411
412func TestDirMkdirSub(t *testing.T) {
413 r, vfs, dir, file1 := dirCreate(t)

Callers

nothing calls this directly

Calls 8

dirCreateFunction · 0.85
checkListingFunction · 0.70
MkdirMethod · 0.65
ErrorMethod · 0.65
ModTimeMethod · 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…