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

Function TestInitDnoteDirs

pkg/cli/context/files_test.go:44–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestInitDnoteDirs(t *testing.T) {
45 tmpDir := t.TempDir()
46
47 paths := Paths{
48 Config: filepath.Join(tmpDir, "config"),
49 Data: filepath.Join(tmpDir, "data"),
50 Cache: filepath.Join(tmpDir, "cache"),
51 }
52
53 // Initialize directories
54 err := InitDnoteDirs(paths)
55 assert.Equal(t, err, nil, "InitDnoteDirs should succeed")
56 assertDirsExist(t, paths)
57
58 // Call again - should be idempotent
59 err = InitDnoteDirs(paths)
60 assert.Equal(t, err, nil, "InitDnoteDirs should succeed when dirs already exist")
61 assertDirsExist(t, paths)
62}

Callers

nothing calls this directly

Calls 3

EqualFunction · 0.92
InitDnoteDirsFunction · 0.85
assertDirsExistFunction · 0.85

Tested by

no test coverage detected