Skip to content

Commit

Permalink
Add test to check _getPerformers and _getComposers
Browse files Browse the repository at this point in the history
Signed-off-by: ABCbum <[email protected]>
Co-authored-by: JoeLametta <[email protected]>
Signed-off-by: JoeLametta <[email protected]>
  • Loading branch information
ABCbum and JoeLametta committed Jan 15, 2020
1 parent 5cd96da commit b79236e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions whipper/test/test_common_mbngs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@ def testTrackTitle(self):
track1 = metadata.tracks[0]
self.assertEqual(track1.title, 'Brownsville Turnaround')

def testComposersAndPerformers(self):
"""
Test whether 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', 'Michael Kamen'])
self.assertEqual(track1.performers, ['Lenny Kravitz', 'Slash'])

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 b79236e

Please sign in to comment.