Skip to content

Commit

Permalink
Add test case to check if a track is classical
Browse files Browse the repository at this point in the history
Use a new classical release Début Recital - Martha Argerich
https://musicbrainz.org/release/5598dd88-5a14-4661-a9cc-fe37a5246028

Signed-off-by: ABCbum <[email protected]>
  • Loading branch information
ABCbum committed Jan 5, 2020
1 parent eda6f5e commit 4ce4224
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions whipper/test/test_common_mbngs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,23 @@ def testTrackTitle(self):
track1 = metadata.tracks[0]
self.assertEqual(track1.title, 'Brownsville Turnaround')

def testClassicalTrack(self):
"""
If track recording artist is different from track artist then
the track is considered classical.
see https:/whipper-team/whipper/issues/191
"""
# Using: Début Recital - Martha Argerich
# https://musicbrainz.org/release/5598dd88-5a14-4661-a9cc-fe37a5246028
filename = 'whipper.release.5598dd88-5a14-4661-a9cc-fe37a5246028.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'])
track1 = metadata.tracks[0]
self.assertTrue(track1.isClassical)

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 4ce4224

Please sign in to comment.