add a test for scan tag errors

This commit is contained in:
sentriz
2022-02-24 16:04:59 +00:00
committed by Senan Kelly
parent 599636663d
commit d3d2ed3469
3 changed files with 41 additions and 2 deletions

View File

@@ -75,6 +75,10 @@ func (m *MockFS) ScanAndClean() *scanner.Context {
return ctx
}
func (m *MockFS) ScanAndCleanErr() (*scanner.Context, error) {
return m.scanner.ScanAndClean(scanner.ScanOptions{})
}
func (m *MockFS) ResetDates() {
t := time.Date(2020, 0, 0, 0, 0, 0, 0, time.UTC)
if err := m.db.Model(db.Album{}).Updates(db.Album{CreatedAt: t, UpdatedAt: t, ModifiedAt: t}).Error; err != nil {
@@ -119,6 +123,10 @@ func (m *MockFS) addItems(prefix string, covers bool) {
}
}
func (m *MockFS) NumTracks() int {
return len(m.tagReader.paths)
}
func (m *MockFS) RemoveAll(path string) {
abspath := filepath.Join(m.dir, path)
if err := os.RemoveAll(abspath); err != nil {