* morituri/test/release.c7d919f4-3ea0-4c4b-a230-b3605f069440.xml:

Add release data for Bettie Serveert, Lamprey
	* morituri/test/test_common_program.py:
	  Add a test for parsing and getting the whole duration.
	* morituri/common/common.py:
	  Add a method to format time.
	* morituri/common/program.py:
	  Add duration to tracks and release metadatas.
	  When there are multiple matches, look up the closest in duration.
	  Make sure that multiple matches closest in duration contain same
	  artist and title.
	  Complain about the other ones.
	* morituri/image/table.py:
	  Add a method to calculate a duration from the table.
	* morituri/test/test_image_table.py:
	  Add a test for it.
This commit is contained in:
Thomas Vander Stichele
2011-08-14 12:18:51 +00:00
parent e95d7a159b
commit d43860bdfb
7 changed files with 183 additions and 3 deletions

View File

@@ -110,3 +110,17 @@ class PathTestCase(unittest.TestCase):
self.assertEquals(path,
u'/tmp/Jeff Buckley/Grace')
class MetadataLengthTestCase(unittest.TestCase):
def testLamprey(self):
from musicbrainz2 import wsxml
path = os.path.join(os.path.dirname(__file__),
'release.c7d919f4-3ea0-4c4b-a230-b3605f069440.xml')
handle = open(path, "rb")
reader = wsxml.MbXmlParser()
wsMetadata = reader.parse(handle)
release = wsMetadata.getRelease()
metadata = progam.getMetadata(release)
self.assertEquals(metadata.duration, 2962889)