Skip to content

Commit

Permalink
Add new test case to check performers, composers
Browse files Browse the repository at this point in the history
This test case verifies that `_getPerformers` and `getComposers` works when
multiple composers or multiple attributes such as additional, guest, solo,
vocal, instrument are present.

Signed-off-by: ABCbum <kimlong221002@gmail.com>
  • Loading branch information
ABCbum committed Jan 8, 2020
1 parent 14535d6 commit 593bd8e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions whipper/test/test_common_mbngs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,27 @@ def testTrackTitle(self):
track1 = metadata.tracks[0]
self.assertEqual(track1.title, 'Brownsville Turnaround')

def testClassicalTrack(self):
"""
Test if composers and performers are extracted properly
see https://github.com/whipper-team/whipper/issues/191
"""
# Using: Mama Said - Lenny Kravitz
# https://musicbrainz.org/release/410f99f8-a876-3416-bd8e-42233a00a477
filename = 'whipper.release.410f99f8-a876-3416-bd8e-42233a00a477.json'
path = os.path.join(os.path.dirname(__file__), filename)
with open(path, "rb") as handle:
response = json.loads(handle.read().decode('utf-8'))

metadata = mbngs._getMetadata(response['release'],
discid='bIOeHwHT0aZJiENIYjAmoNxCPuA-')
track1 = metadata.tracks[0]
self.assertEqual(track1.composers, 'Hal Fredericks and Michael Kamen')
self.assertEqual(track1.performers, ['bass guitar, guitar family, '
'mellotron, membranophone: Lenny '
'Kravitz', 'guest guitar: Slash',
'vocal: Lenny Kravitz'])

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

0 comments on commit 593bd8e

Please sign in to comment.