* 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:
Thomas Vander Stichele
2011-03-23 19:40:47 +00:00
parent 6a8355b109
commit f8409b29e1
4 changed files with 2552 additions and 0 deletions

View File

@@ -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 %')