From 0822fa2f8297af0d004c906a39e181dcaaf51048 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 24 Jan 2011 20:22:13 -0800 Subject: [PATCH] test that autotagger sets track artist to match album artist --- NEWS | 2 ++ test/test_autotag.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/NEWS b/NEWS index b5d8324ed..cf5b0575a 100644 --- a/NEWS +++ b/NEWS @@ -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. diff --git a/test/test_autotag.py b/test/test_autotag.py index 4ce263629..90e183073 100644 --- a/test/test_autotag.py +++ b/test/test_autotag.py @@ -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 = []