mirror of
https://github.com/beetbox/beets.git
synced 2026-01-11 02:13:28 +01:00
test.helper: Allow extra track values in generate_album_info.
This commit is contained in:
parent
3b03372502
commit
81e1fc1a7e
2 changed files with 5 additions and 5 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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'})
|
||||
|
|
|
|||
Loading…
Reference in a new issue