Files
whipper-gui/morituri/test/test_image_table.py
Thomas Vander Stichele 262801e554 * morituri/rip/cd.py:
Add asserts for comparing id's between the simple toc and
	  the full table.
	  Create the output directory before ripping the htoa.
	  Ignore data tracks for now.
	  Don't fail if we have no AccurateRip responses.
	* morituri/image/table.py:
	  Add a session ivar to Track.
	  Factor in session leadin when calculating track length
	  of last track in a session.
	  add getMusicBrainzSubmitURL()
	  add _getSessionGap() because the session gap size is different
	  for session 2 and all following.
	  Use it in merge() to get offsets right.
	  Fix getAccurateRipURL by only using the audio tracks for the
	  'length in tracks' number
	  Temporarily disable writing out data tracks to a .cue file,
	  since it's not implemented yet.
	  Add canCue to see if we can write a .cue file from the given table,
	  and debug why not if not.
	* morituri/program/cdrdao.py:
	  Rework to rip each session separately instead of using session 9.
	  This fixes session 9 read-toc missing the pregap.
	  Add a simple LineParser for handling output from disk-info.
	  Count tracks relatively for the session, because the output for
	  session 2 for track numbers picks up where session 1 left off.
	  Don't set leadout from TOC printing since for the same reason
	  session 2's leadout is absolute, not relative to start of session.
	  Add a DiscInfoTask.
	  Convert Table and Toc reading tasks to multitasks, first getting the
	  number of sessions, then reading table/toc for each session.
	* morituri/test/test_image_table.py:
	  Fix up MusicBrainz disc id for my Ladyhawke disc.
	  Add AccurateRip URL verification, compared against EAC's.
	* morituri/test/test_image_toc.py:
	  Use two separate session read-toc output files to verify
	  the case of Das Capital.
	  Verify musicbrainz URL.
2009-05-25 14:59:45 +00:00

81 lines
2.6 KiB
Python

# -*- Mode: Python; test-case-name: morituri.test.test_image_table -*-
# vi:si:et:sw=4:sts=4:ts=4
from morituri.image import table
import unittest
from morituri.test import common
def h(i):
return "0x%08x" % i
class LadyhawkeTestCase(unittest.TestCase):
# Ladyhawke - Ladyhawke - 0602517818866
# contains 12 audio tracks and one data track
# CDDB has been verified against freedb:
# http://www.freedb.org/freedb/misc/c60af50d
# http://www.freedb.org/freedb/jazz/c60af50d
# AccurateRip URL has been verified against EAC's, using wireshark
def setUp(self):
self.table = table.Table()
for i in range(12):
self.table.tracks.append(table.Track(i + 1, audio=True))
self.table.tracks.append(table.Track(13, audio=False))
offsets = [0, 15537, 31691, 50866, 66466, 81202, 99409,
115920, 133093, 149847, 161560, 177682, 207106]
t = self.table.tracks
for i, offset in enumerate(offsets):
t[i].index(1, absolute=offset)
self.failIf(self.table.hasTOC())
self.table.leadout = 210385
self.failUnless(self.table.hasTOC())
def testCDDB(self):
self.assertEquals(self.table.getCDDBDiscId(), "c60af50d")
def testMusicBrainz(self):
# output from mb-submit-disc:
# http://mm.musicbrainz.org/bare/cdlookup.html?toc=1+12+195856+150+15687+31841+51016+66616+81352+99559+116070+133243+149997+161710+177832&tracks=12&id=KnpGsLhvH.lPrNc1PBL21lb9Bg4-
# however, not (yet) in musicbrainz database
self.assertEquals(self.table.getMusicBrainzDiscId(),
"KnpGsLhvH.lPrNc1PBL21lb9Bg4-")
def testAccurateRip(self):
self.assertEquals(self.table.getAccurateRipIds(), (
"0013bd5a", "00b8d489"))
self.assertEquals(self.table.getAccurateRipURL(),
"http://www.accuraterip.com/accuraterip/a/5/d/dBAR-012-0013bd5a-00b8d489-c60af50d.bin")
class MusicBrainzTestCase(unittest.TestCase):
# example taken from http://musicbrainz.org/doc/DiscIDCalculation
# disc is Ettella Diamant
def setUp(self):
self.table = table.Table()
for i in range(6):
self.table.tracks.append(table.Track(i + 1, audio=True))
offsets = [0, 15213, 32164, 46442, 63264, 80339]
t = self.table.tracks
for i, offset in enumerate(offsets):
t[i].index(1, absolute=offset)
self.failIf(self.table.hasTOC())
self.table.leadout = 95312
self.failUnless(self.table.hasTOC())
def testMusicBrainz(self):
self.assertEquals(self.table.getMusicBrainzDiscId(),
'49HHV7Eb8UKF3aQiNmu1GR8vKTY-')