From efc88193f9c4f02791b1f0f7fc5cd69eb1b88156 Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Fri, 31 Mar 2023 18:55:57 +0200 Subject: [PATCH] Add test_reimported_album_not_preserves_flexattr Checks if a reimported album flexible attribute "data_source" will be updated correctly from the match being applied. --- test/test_importer.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/test_importer.py b/test/test_importer.py index 121de53d6..7de00c65e 100644 --- a/test/test_importer.py +++ b/test/test_importer.py @@ -139,7 +139,8 @@ class AutotagStub: va=False, album_id='albumid' + id, artist_id='artistid' + id, - albumtype='soundtrack' + albumtype='soundtrack', + data_source='match_source' ) @@ -1723,6 +1724,7 @@ class ReimportTest(unittest.TestCase, ImportHelper, _common.Assertions): album = self.add_album_fixture() album.added = 4242.0 album.foo = 'bar' # Some flexible attribute. + album.data_source = 'original_source' album.store() item = album.items().get() item.baz = 'qux' @@ -1804,6 +1806,12 @@ class ReimportTest(unittest.TestCase, ImportHelper, _common.Assertions): if new_artpath != old_artpath: self.assertNotExists(old_artpath) + def test_reimported_album_not_preserves_flexattr(self): + self._setup_session() + self.assertEqual(self._album().data_source, 'original_source') + self.importer.run() + self.assertEqual(self._album().data_source, 'match_source') + class ImportPretendTest(_common.TestCase, ImportHelper): """ Test the pretend commandline option