From 81e1fc1a7eb20cf19b99d71fa7c097698a3a356a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Detrey?= Date: Tue, 8 May 2018 16:59:41 +0200 Subject: [PATCH] test.helper: Allow extra track values in `generate_album_info`. --- test/helper.py | 8 ++++---- test/test_mbsync.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/helper.py b/test/helper.py index 5b3bec8b5..21346312c 100644 --- a/test/helper.py +++ b/test/helper.py @@ -557,16 +557,16 @@ class TestImportSession(importer.ImportSession): task.should_merge_duplicates = True -def generate_album_info(album_id, track_ids): +def generate_album_info(album_id, track_values): """Return `AlbumInfo` populated with mock data. Sets the album info's `album_id` field is set to the corresponding - argument. For each value in `track_ids` the `TrackInfo` from - `generate_track_info` is added to the album info's `tracks` field. + argument. For each pair (`id`, `values`) in `track_values` the `TrackInfo` + from `generate_track_info` is added to the album info's `tracks` field. Most other fields of the album and track info are set to "album info" and "track info", respectively. """ - tracks = [generate_track_info(id) for id in track_ids] + tracks = [generate_track_info(id, values) for id, values in track_values] album = AlbumInfo( album_id=u'album info', album=u'album info', diff --git a/test/test_mbsync.py b/test/test_mbsync.py index 411af8d0a..17f500200 100644 --- a/test/test_mbsync.py +++ b/test/test_mbsync.py @@ -41,7 +41,7 @@ class MbsyncCliTest(unittest.TestCase, TestHelper): @patch('beets.autotag.hooks.track_for_mbid') def test_update_library(self, track_for_mbid, album_for_mbid): album_for_mbid.return_value = \ - generate_album_info('album id', ['track id']) + generate_album_info('album id', [('track id', {})]) track_for_mbid.return_value = \ generate_track_info(u'singleton track id', {'title': u'singleton info'})