Add test coverage for scanning of Ogg files

Provide a song1.ogg audio file, converted from the tests/data/scanner/simple/song1.mp3
file, and perform the same test checks on its scanned data that are performed for
song1.mp3. The expected results are the same except for a small difference in the
reported duration.
(cherry picked from commit 61aa28f8a562f0b0722e2b3414677da82588fdb8)
This commit is contained in:
Zan Dobersek 2013-03-25 12:51:37 +01:00 committed by Stein Magnus Jodal
parent 228f9bbf6b
commit 7c115076b0
2 changed files with 7 additions and 0 deletions

Binary file not shown.

View File

@ -172,22 +172,29 @@ class ScannerTest(unittest.TestCase):
self.check(
'scanner/simple/song1.mp3', 'uri',
'file://%s' % path_to_data_dir('scanner/simple/song1.mp3'))
self.check(
'scanner/simple/song1.ogg', 'uri',
'file://%s' % path_to_data_dir('scanner/simple/song1.ogg'))
def test_duration_is_set(self):
self.scan('scanner/simple')
self.check('scanner/simple/song1.mp3', 'duration', 4680)
self.check('scanner/simple/song1.ogg', 'duration', 4608)
def test_artist_is_set(self):
self.scan('scanner/simple')
self.check('scanner/simple/song1.mp3', 'artist', 'name')
self.check('scanner/simple/song1.ogg', 'artist', 'name')
def test_album_is_set(self):
self.scan('scanner/simple')
self.check('scanner/simple/song1.mp3', 'album', 'albumname')
self.check('scanner/simple/song1.ogg', 'album', 'albumname')
def test_track_is_set(self):
self.scan('scanner/simple')
self.check('scanner/simple/song1.mp3', 'title', 'trackname')
self.check('scanner/simple/song1.ogg', 'title', 'trackname')
def test_nonexistant_folder_does_not_fail(self):
self.scan('scanner/does-not-exist')