* morituri/test/Makefile.am:

* morituri/test/morituri.release.3451f29c-9bb8-4cc5-bfcc-bd50104b94f8.json (added):
	* morituri/test/test_common_musicbrainzngs.py (added):
	  Add test for previous bug of a release not having a date.
This commit is contained in:
Thomas Vander Stichele
2011-10-28 17:50:18 +00:00
parent c2838ad05c
commit 2be21bce3c
4 changed files with 33 additions and 0 deletions

View File

@@ -1,3 +1,10 @@
2011-10-28 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/test/Makefile.am:
* morituri/test/morituri.release.3451f29c-9bb8-4cc5-bfcc-bd50104b94f8.json (added):
* morituri/test/test_common_musicbrainzngs.py (added):
Add test for previous bug of a release not having a date.
2011-10-28 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/rip/main.py:

View File

@@ -6,6 +6,7 @@ EXTRA_DIST = \
test_common_accurip.py \
test_common_checksum.py \
test_common_musicbrainz.py \
test_common_musicbrainzngs.py \
test_common_program.py \
test_common_renamer.py \
test_image_cue.py \
@@ -29,6 +30,7 @@ EXTRA_DIST = \
release.08397059-86c1-463b-8ed0-cd596dbd174f.xml \
release.93a6268c-ddf1-4898-bf93-fb862b1c5c5e.xml \
release.c7d919f4-3ea0-4c4b-a230-b3605f069440.xml \
morituri.release.3451f29c-9bb8-4cc5-bfcc-bd50104b94f8.json \
kanye.cue \
kings-separate.cue \
kings-single.cue \

View File

@@ -0,0 +1 @@
{"release": {"status": "Official", "artist-credit": [{"artist": {"sort-name": "Buckley, Jeff", "id": "e6e879c0-3d56-4f12-b3c5-3ce459661a8e", "name": "Jeff Buckley"}}], "text-representation": {"language": "eng", "script": "Latn"}, "title": "Everybody Here Wants You", "artist-credit-phrase": "Jeff Buckley", "quality": "normal", "id": "3451f29c-9bb8-4cc5-bfcc-bd50104b94f8", "medium-list": [{"disc-list": [{"id": "C6N7.QADBQ968Qr8OOjxfQlGtA8-", "sectors": "122983"}, {"id": "wbjbST2jUHRZaB1inCyxxsL7Eqc-", "sectors": "122833"}], "position": "1", "track-list": [{"recording": {"artist-credit": [{"artist": {"sort-name": "Buckley, Jeff", "id": "e6e879c0-3d56-4f12-b3c5-3ce459661a8e", "name": "Jeff Buckley"}}], "length": "286920", "artist-credit-phrase": "Jeff Buckley", "id": "8f8c284b-6818-4a66-a517-37dc8c04a881", "title": "Everybody Here Wants You"}, "position": "1"}, {"recording": {"artist-credit": [{"artist": {"sort-name": "Buckley, Jeff", "id": "e6e879c0-3d56-4f12-b3c5-3ce459661a8e", "name": "Jeff Buckley"}}], "length": "204746", "artist-credit-phrase": "Jeff Buckley", "id": "7d939d14-06a2-478e-b279-ebe20fae8b2f", "title": "Thousand Fold"}, "position": "2"}, {"recording": {"artist-credit": [{"artist": {"sort-name": "Buckley, Jeff", "id": "e6e879c0-3d56-4f12-b3c5-3ce459661a8e", "name": "Jeff Buckley"}}], "length": "288466", "artist-credit-phrase": "Jeff Buckley", "id": "54323c4c-e0f6-4a81-8b80-e1c0b822a3f7", "title": "Eternal Life (road version)"}, "position": "3"}, {"recording": {"artist-credit": [{"artist": {"sort-name": "Buckley, Jeff", "id": "e6e879c0-3d56-4f12-b3c5-3ce459661a8e", "name": "Jeff Buckley"}}], "length": "574026", "artist-credit-phrase": "Jeff Buckley", "id": "4dda67d1-8123-4545-9a78-7b4232089e96", "title": "Hallelujah (live)"}, "position": "4"}, {"recording": {"artist-credit": [{"artist": {"sort-name": "Buckley, Jeff", "id": "e6e879c0-3d56-4f12-b3c5-3ce459661a8e", "name": "Jeff Buckley"}}], "length": "284000", "artist-credit-phrase": "Jeff Buckley", "id": "5db42013-aa5c-4eb4-a549-46ca721990cf", "title": "Last Goodbye (live from Sydney)"}, "position": "5"}], "format": "CD"}]}}

View File

@@ -0,0 +1,23 @@
# -*- Mode: Python; test-case-name: morituri.test.test_common_musicbrainzngs -*-
# vi:si:et:sw=4:sts=4:ts=4
import os
import json
import unittest
from morituri.common import musicbrainzngs
class MetadataTestCase(unittest.TestCase):
def testJeffEverybodySingle(self):
path = os.path.join(os.path.dirname(__file__),
'morituri.release.3451f29c-9bb8-4cc5-bfcc-bd50104b94f8.json')
handle = open(path, "rb")
response = json.loads(handle.read())
handle.close()
discid = "wbjbST2jUHRZaB1inCyxxsL7Eqc-"
metadata = musicbrainzngs._getMetadata(response['release'], discid)
self.failIf(metadata.release)