MCPcopy
hub / github.com/NVIDIA/aistore / TestGetFilesCount

Function TestGetFilesCount

ios/fsutils_test.go:44–65  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestGetFilesCount(t *testing.T) {
45 name, err := os.MkdirTemp("/tmp", t.Name())
46 if err != nil {
47 t.Error(err)
48 }
49 defer os.RemoveAll(name)
50
51 checkFileCount(t, name, 0)
52
53 nameInside, err := os.MkdirTemp(name, "")
54 if err != nil {
55 t.Error(err)
56 }
57
58 checkFileCount(t, name, 0)
59
60 mkFile(t, name)
61 checkFileCount(t, name, 1)
62
63 mkFile(t, nameInside)
64 checkFileCount(t, name, 2)
65}
66
67func mkFile(t *testing.T, dir string) {
68 f, err := os.Create(path.Join(dir, "file.txt"))

Callers

nothing calls this directly

Calls 4

checkFileCountFunction · 0.85
mkFileFunction · 0.85
NameMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected