def test_album_id_values_with_artist(self): album_key_tests = [ # The artist should now appear ({"album": "foo", "artist": "bar", "title": "baz"}, {"album": "foo", "artist": "bar"}), # But albumartist > album still ({"album": "foo", "albumartist": "bar", "artist": "baz"}, {"album": "foo", "albumartist": "bar"}), ] for tags, expected in album_key_tests: if expected is None: expected = tags afile = AudioFile(**tags) afile.sanitize("/dir/fn") # Use alternate version, that includes artist in dict self.failUnlessEqual(afile._album_id_values(True), HashableDict(expected))