mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 21:09:05 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user