mirror of
https://github.com/photoprism/photoprism.git
synced 2026-01-23 02:24:24 +00:00
Pkg: Use ProjectRoot variable in path_test.go
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
3874bc5422
commit
bbee0993e0
2 changed files with 9 additions and 1 deletions
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"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue