test helper: add support for multi-disc album fixtures
@@ -373,15 +373,17 @@ class TestHelper:
items.append(item)
return items
- def add_album_fixture(self, track_count=1, ext='mp3'):
+ def add_album_fixture(self, track_count=1, ext='mp3', disc_count=1):
"""Add an album with files to the database.
"""
items = []
path = os.path.join(_common.RSRC, util.bytestring_path('full.' + ext))
+ for discnumber in range(1, disc_count + 1):
for i in range(track_count):
item = Item.from_path(path)
item.album = '\u00e4lbum' # Check unicode paths
item.title = f't\u00eftle {i}'
+ item.disc = discnumber
# mtime needs to be set last since other assignments reset it.
item.mtime = 12345
item.add(self.lib)
