Include a group of small but real media files for testing. (#1131)

* Move scanner/test_data/* to a stand-alone directory.

* Include real medias.

* Rename testdata to test_data

* Rename test_data/scanner -> test_data/library

* Clean tests to avoid depneding env.

* Rename: scanner/test_data -> scanner/test_media

* Rename: test_data/bin -> test_data/mock_bin

* Fix paths in tests.
This commit is contained in:
Googol Lee
2024-11-23 09:02:11 +01:00
committed by GitHub
parent dde45c29b9
commit f1b523a27e
52 changed files with 75 additions and 65 deletions

View File

@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
)
const testDataPath = "./test_data"
const testDataPath = "./test_media/library"
func TestNewRootPath(t *testing.T) {
db := test_utils.DatabaseTest(t)
@@ -29,7 +29,7 @@ func TestNewRootPath(t *testing.T) {
}
assert.NotNil(t, album)
assert.Contains(t, album.Path, "/api/scanner/test_data")
assert.Contains(t, album.Path, "/api/scanner/test_media")
assert.NotEmpty(t, album.Owners)
})
@@ -65,7 +65,7 @@ func TestNewRootPath(t *testing.T) {
}
assert.NotNil(t, album)
assert.Contains(t, album.Path, "/api/scanner/test_data")
assert.Contains(t, album.Path, "/api/scanner/test_media")
ownerCount := db.Model(&album).Association("Owners").Count()
assert.EqualValues(t, 2, ownerCount)