MCPcopy
hub / github.com/rclone/rclone / TestGetFile2

Function TestGetFile2

fs/cache/cache_test.go:83–107  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestGetFile2(t *testing.T) {
84 defer ClearMappings()
85 create := mockNewFs(t)
86
87 assert.Equal(t, 0, Entries())
88
89 f, err := GetFn(context.Background(), "mock:file.txt", create)
90 require.Equal(t, fs.ErrorIsFile, err)
91 require.NotNil(t, f)
92
93 assert.Equal(t, 1, Entries())
94
95 f2, err := GetFn(context.Background(), "mock:file.txt", create)
96 require.Equal(t, fs.ErrorIsFile, err)
97 require.NotNil(t, f2)
98
99 assert.Equal(t, f, f2)
100
101 // check it is also found when referred to by parent name
102 f2, err = GetFn(context.Background(), "mock:/", create)
103 require.Nil(t, err)
104 require.NotNil(t, f2)
105
106 assert.Equal(t, f, f2)
107}
108
109func TestGetError(t *testing.T) {
110 create := mockNewFs(t)

Callers

nothing calls this directly

Calls 5

ClearMappingsFunction · 0.85
EntriesFunction · 0.85
GetFnFunction · 0.85
mockNewFsFunction · 0.70
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…