create basic controller

This commit is contained in:
Ilia Denisov
2025-09-26 20:54:34 +03:00
parent 282150a253
commit 66eeefc65d
13 changed files with 357 additions and 165 deletions
+5 -4
View File
@@ -6,30 +6,31 @@ import (
"testing"
"github.com/google/uuid"
"github.com/iliadenisov/galaxy/pkg/util"
"github.com/stretchr/testify/assert"
)
func TestPathExists(t *testing.T) {
root, cleanup := createWorkDir(t)
root, cleanup := util.CreateWorkDir(t)
defer cleanup()
testDirExistsFunc(t, root, func(s string) (bool, error) { return pathExists(s, true) })
testFileExistsFunc(t, root, func(s string) (bool, error) { return pathExists(s, false) })
}
func TestDirExists(t *testing.T) {
root, cleanup := createWorkDir(t)
root, cleanup := util.CreateWorkDir(t)
defer cleanup()
testDirExistsFunc(t, root, dirExists)
}
func TestFileExists(t *testing.T) {
root, cleanup := createWorkDir(t)
root, cleanup := util.CreateWorkDir(t)
defer cleanup()
testFileExistsFunc(t, root, fileExists)
}
func TestWritable(t *testing.T) {
root, cleanup := createWorkDir(t)
root, cleanup := util.CreateWorkDir(t)
defer cleanup()
ok, err := writable(root)
assert.NoError(t, err, "directory writable check")