mirror of
https://github.com/beetbox/beets.git
synced 2025-12-29 20:12:33 +01:00
Update re-import test to leave no orphaned art
Make sure that when an album is re-imported and its files are moved, the artwork isn't left behind in the old folder.
This commit is contained in:
parent
32934bd16a
commit
314dd0e6bc
1 changed files with 6 additions and 3 deletions
|
|
@ -1594,15 +1594,18 @@ class ReimportTest(unittest.TestCase, ImportHelper):
|
|||
|
||||
def test_reimported_item_preserves_art(self):
|
||||
self._setup_session()
|
||||
artpath = os.path.join(_common.RSRC, 'abbey.jpg')
|
||||
art_source = os.path.join(_common.RSRC, 'abbey.jpg')
|
||||
replaced_album = self._album()
|
||||
replaced_album.set_art(artpath)
|
||||
replaced_album.set_art(art_source)
|
||||
replaced_album.store()
|
||||
old_artpath = replaced_album.artpath
|
||||
self.importer.run()
|
||||
new_album = self._album()
|
||||
new_artpath = new_album.art_destination(artpath)
|
||||
new_artpath = new_album.art_destination(art_source)
|
||||
self.assertEqual(new_album.artpath, new_artpath)
|
||||
self.assertTrue(os.path.exists(new_artpath))
|
||||
if new_artpath != old_artpath:
|
||||
self.assertFalse(os.path.exists(old_artpath))
|
||||
|
||||
|
||||
class ImportPretendTest(_common.TestCase, ImportHelper):
|
||||
|
|
|
|||
Loading…
Reference in a new issue