test that autotagger sets track artist to match album artist

This commit is contained in:
Adrian Sampson 2011-01-24 20:22:13 -08:00
parent 0e7679c1b9
commit 0822fa2f82
2 changed files with 18 additions and 0 deletions

2
NEWS
View file

@ -13,6 +13,8 @@
default path formats have been changed to use $albumartist instead
of $artist. More information about this change is available on the
wiki.
* A new "albumtype" field reflects the release type as specified by
MusicBrainz: http://wiki.musicbrainz.org/ReleaseType
* Fix a bug where some files would be erroneously interpreted as MP4.
* Fix permission bits applied to album art files.
* The old "albumify" plugin for upgrading databases was removed.

View file

@ -249,6 +249,22 @@ class ApplyTest(unittest.TestCase):
self.assertEqual(self.items[0].albumtype, 'album')
self.assertEqual(self.items[1].albumtype, 'album')
def test_album_artist_overrides_empty_track_artist(self):
my_info = dict(self.info)
my_info['tracks'] = [dict(t) for t in self.info['tracks']]
autotag.apply_metadata(self.items, my_info)
self.assertEqual(self.items[0].artist, 'artistNew')
self.assertEqual(self.items[0].artist, 'artistNew')
def test_album_artist_overriden_by_nonempty_track_artist(self):
my_info = dict(self.info)
my_info['tracks'] = [dict(t) for t in self.info['tracks']]
my_info['tracks'][0]['artist'] = 'artist1!'
my_info['tracks'][1]['artist'] = 'artist2!'
autotag.apply_metadata(self.items, my_info)
self.assertEqual(self.items[0].artist, 'artist1!')
self.assertEqual(self.items[1].artist, 'artist2!')
class ApplyCompilationTest(unittest.TestCase):
def setUp(self):
self.items = []