mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Pkg: Use ProjectRoot variable in path_test.go
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
8
pkg/clean/clean_test.go
Normal file
8
pkg/clean/clean_test.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package clean
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// ProjectRoot references the project root directory for use in tests.
|
||||
var ProjectRoot = func() string { dir, _ := filepath.Abs("../../"); return dir }()
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
func TestPath(t *testing.T) {
|
||||
t.Run("ValidPath", func(t *testing.T) {
|
||||
assert.Equal(t, "/go/src/github.com/photoprism/photoprism", Path("/go/src/github.com/photoprism/photoprism"))
|
||||
assert.Equal(t, ProjectRoot, Path(ProjectRoot))
|
||||
})
|
||||
t.Run("ValidFile", func(t *testing.T) {
|
||||
assert.Equal(t, "filename.TXT", Path("filename.TXT"))
|
||||
|
||||
Reference in New Issue
Block a user