Add testcase for failure when missing release type

See https://github.com/whipper-team/whipper/issues/396

Signed-off-by: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
This commit is contained in:
Frederik “Freso” S. Olesen
2019-05-02 18:24:13 +02:00
parent 3a61960e5f
commit 8209927a79
2 changed files with 16 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
# -*- Mode: Python; test-case-name: whipper.test.test_common_mbngs -*-
# vi:si:et:sw=4:sts=4:ts=4
# vi:si:et:sw=4:sts=4:ts=4:set fileencoding=utf-8
import os
import json
@@ -207,6 +207,20 @@ class MetadataTestCase(unittest.TestCase):
self.assertEqual(track2.mbidRecording,
u'5f19758e-7421-4c71-a599-9a9575d8e1b0')
def testMissingReleaseGroupType(self):
"""Check that whipper doesn't break if there's no type."""
# Using: Gustafsson, Österberg & Cowle - What's Up? 8 (disc 4)
# https://musicbrainz.org/release/d8e6153a-2c47-4804-9d73-0aac1081c3b1
filename = 'whipper.release.d8e6153a-2c47-4804-9d73-0aac1081c3b1.json'
path = os.path.join(os.path.dirname(__file__), filename)
handle = open(path, "rb")
response = json.loads(handle.read())
handle.close()
discid = "xu338_M8WukSRi0J.KTlDoflB8Y-" # disc 4
metadata = mbngs._getMetadata(response['release'], discid)
self.assertEqual(metadata.releaseType, u'')
def testAllAvailableMetadata(self):
"""Check that all possible metadata gets assigned."""
# Using: David Rovics - The Other Side

File diff suppressed because one or more lines are too long