Skip to content

Commit

Permalink
Add testcase for failure when missing release type
Browse files Browse the repository at this point in the history
See #396

Signed-off-by: Frederik “Freso” S. Olesen <[email protected]>
  • Loading branch information
Freso committed May 2, 2019
1 parent 3a61960 commit 8209927
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion whipper/test/test_common_mbngs.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -207,6 +207,20 @@ def testNenaAndKimWildSingle(self):
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
Expand Down

Large diffs are not rendered by default.

0 comments on commit 8209927

Please sign in to comment.