MCPcopy Create free account
hub / github.com/dnote/dnote / assertDirsExist

Function assertDirsExist

pkg/cli/context/files_test.go:27–42  ·  view source on GitHub ↗
(t *testing.T, paths Paths)

Source from the content-addressed store, hash-verified

25)
26
27func assertDirsExist(t *testing.T, paths Paths) {
28 configDir := filepath.Join(paths.Config, consts.DnoteDirName)
29 info, err := os.Stat(configDir)
30 assert.Equal(t, err, nil, "config dir should exist")
31 assert.Equal(t, info.IsDir(), true, "config should be a directory")
32
33 dataDir := filepath.Join(paths.Data, consts.DnoteDirName)
34 info, err = os.Stat(dataDir)
35 assert.Equal(t, err, nil, "data dir should exist")
36 assert.Equal(t, info.IsDir(), true, "data should be a directory")
37
38 cacheDir := filepath.Join(paths.Cache, consts.DnoteDirName)
39 info, err = os.Stat(cacheDir)
40 assert.Equal(t, err, nil, "cache dir should exist")
41 assert.Equal(t, info.IsDir(), true, "cache should be a directory")
42}
43
44func TestInitDnoteDirs(t *testing.T) {
45 tmpDir := t.TempDir()

Callers 1

TestInitDnoteDirsFunction · 0.85

Calls 1

EqualFunction · 0.92

Tested by

no test coverage detected