* morituri/program/cdparanoia.py:
cdparanoia can hang indefinitely on scsi read errors. For example, on some drives, when trying negative offsets. Notice them, count them, and fail after 100. * morituri/test/test_program_cdparanoia.py: * morituri/test/cdparanoia.progress.error (added): Add a test for this output.
This commit is contained in:
@@ -22,3 +22,21 @@ class ParseTestCase(unittest.TestCase):
|
||||
|
||||
q = '%.01f %%' % (self._parser.getTrackQuality() * 100.0, )
|
||||
self.assertEquals(q, '99.7 %')
|
||||
|
||||
class ErrorTestCase(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
# report from a rip with offset -1164 causing scsi errors
|
||||
path = os.path.join(os.path.dirname(__file__),
|
||||
'cdparanoia.progress.error')
|
||||
self._parser = cdparanoia.ProgressParser(start=0, stop=10800)
|
||||
|
||||
self._handle = open(path)
|
||||
|
||||
def testParse(self):
|
||||
for line in self._handle.readlines():
|
||||
self._parser.parse(line)
|
||||
|
||||
q = '%.01f %%' % (self._parser.getTrackQuality() * 100.0, )
|
||||
self.assertEquals(q, '99.7 %')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user