MCPcopy
hub / github.com/rclone/rclone / fileCreate

Function fileCreate

vfs/file_test.go:21–35  ·  view source on GitHub ↗
(t *testing.T, mode vfscommon.CacheMode)

Source from the content-addressed store, hash-verified

19)
20
21func fileCreate(t *testing.T, mode vfscommon.CacheMode) (r *fstest.Run, vfs *VFS, fh *File, item fstest.Item) {
22 opt := vfscommon.Opt
23 opt.CacheMode = mode
24 opt.WriteBack = writeBackDelay
25 r, vfs = newTestVFSOpt(t, &opt)
26
27 file1 := r.WriteObject(context.Background(), "dir/file1", "file1 contents", t1)
28 r.CheckRemoteItems(t, file1)
29
30 node, err := vfs.Stat("dir/file1")
31 require.NoError(t, err)
32 require.True(t, node.Mode().IsRegular())
33
34 return r, vfs, node.(*File), file1
35}
36
37func TestFileMethods(t *testing.T) {
38 r, vfs, file, _ := fileCreate(t, vfscommon.CacheModeOff)

Callers 8

TestFileMethodsFunction · 0.85
testFileSetModTimeFunction · 0.85
TestFileOpenReadFunction · 0.85
TestFileOpenWriteFunction · 0.85
TestFileRemoveFunction · 0.85
TestFileRemoveAllFunction · 0.85
TestFileOpenFunction · 0.85
testFileRenameFunction · 0.85

Calls 5

newTestVFSOptFunction · 0.85
WriteObjectMethod · 0.80
CheckRemoteItemsMethod · 0.80
StatMethod · 0.65
ModeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…