Skip to content

Commit

Permalink
Add test case to check for track title
Browse files Browse the repository at this point in the history
Using an existing JSON release file

Signed-off-by: ABCbum <kimlong221002@gmail.com>
  • Loading branch information
ABCbum committed Dec 13, 2019
1 parent 758f854 commit 93cf9f6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions whipper/test/test_common_mbngs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ def testMissingReleaseDate(self):

self.assertFalse(metadata.release)

def testTrackTitle(self):
"""
Check that the track title metadata is taken from MusicBrainz's track
title (which may differ from the recording title, as in this case)
see https://github.com/whipper-team/whipper/issues/192
"""
# Using: The KLF - Space & Chill Out
# https://musicbrainz.org/release/c56ff16e-1d81-47de-926f-ba22891bd2bd
filename = 'whipper.release.c56ff16e-1d81-47de-926f-ba22891bd2bd.json'
path = os.path.join(os.path.dirname(__file__), filename)
with open(path, "rb") as handle:
response = json.loads(handle.read().decode('utf-8'))
discid = "b.yqPuCBdsV5hrzDvYrw52iK_jE-"

metadata = mbngs._getMetadata(response['release'], discid)
track1 = metadata.tracks[0]
self.assertEqual(track1.title, 'Brownsville Turnaround')

def test2MeterSessies10(self):
# various artists, multiple artists per track
filename = 'whipper.release.a76714e0-32b1-4ed4-b28e-f86d99642193.json'
Expand Down

0 comments on commit 93cf9f6

Please sign in to comment.