Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Check for _genres and _folksonomy_tags individually as both are filled in separately
now.
  • Loading branch information
rakim-0 committed Oct 21, 2024
1 parent d543ec0 commit c82f01c
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions test/test_mbjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,14 @@ def test_release(self):
self.assertEqual(m['~release_seriesid'], '7421b602-a413-4151-bcf4-d831debc3f27')
self.assertEqual(m['~release_seriescomment'], 'Pink Floyed special editions')
self.assertEqual(m['~release_seriesnumber'], '')
self.assertEqual(a.genres, {
'genre1': 6, 'genre2': 3,
'tag1': 6, 'tag2': 3})
self.assertEqual(a._genres, {
'genre1': 6, 'genre2': 3
})
self.assertEqual(a._folksonomy_tags, {
'tag1': 6, 'tag2': 3
})
for artist in a._album_artists:
self.assertEqual(artist.genres, {
self.assertEqual(artist._folksonomy_tags, {
'british': 2,
'progressive rock': 10})

Expand All @@ -166,11 +169,14 @@ def test_release_without_release_relationships(self):
self.assertEqual(m['~albumartists_sort'], 'Pink Floyd')
self.assertEqual(m['~releaselanguage'], 'eng')
self.assertEqual(m.getall('~releasecountries'), ['GB', 'NZ'])
self.assertEqual(a.genres, {
'genre1': 6, 'genre2': 3,
'tag1': 6, 'tag2': 3})
self.assertEqual(a._genres, {
'genre1': 6, 'genre2': 3
})
self.assertEqual(a._folksonomy_tags, {
'tag1': 6, 'tag2': 3
})
for artist in a._album_artists:
self.assertEqual(artist.genres, {
self.assertEqual(artist._folksonomy_tags, {
'british': 2,
'progressive rock': 10})

Expand Down Expand Up @@ -293,11 +299,11 @@ def test_recording(self):
self.assertEqual(m['~video'], '')
self.assertNotIn('originaldate', m)
self.assertNotIn('originalyear', m)
self.assertEqual(t.genres, {
self.assertEqual(t._folksonomy_tags, {
'blue-eyed soul': 1,
'pop': 3})
for artist in t._track_artists:
self.assertEqual(artist.genres, {
self.assertEqual(artist._folksonomy_tags, {
'dance-pop': 1,
'guitarist': 0})

Expand Down Expand Up @@ -770,7 +776,7 @@ def test_release_group(self):
self.assertEqual(m['releasetype'], 'album')
self.assertEqual(m['~primaryreleasetype'], 'album')
self.assertEqual(m['~releasegroup'], 'The Dark Side of the Moon')
self.assertEqual(r.genres, {'test2': 3, 'test': 6})
self.assertEqual(r._folksonomy_tags, {'test2': 3, 'test': 6})


class NullReleaseGroupTest(MBJSONTest):
Expand Down

0 comments on commit c82f01c

Please sign in to comment.