mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 11:32:30 +01:00
scrub on import tests
This commit is contained in:
parent
c3a4356773
commit
8defbe4093
1 changed files with 38 additions and 0 deletions
|
|
@ -244,6 +244,44 @@ class ImportHelper(TestHelper):
|
|||
self.assertEqual(len(os.listdir(syspath(self.libdir))), 0)
|
||||
|
||||
|
||||
class ScrubbedImportTest(_common.TestCase, ImportHelper):
|
||||
def setUp(self):
|
||||
self.setup_beets(disk=True)
|
||||
self.load_plugins('scrub')
|
||||
self._create_import_dir(2)
|
||||
self._setup_import_session(autotag=False)
|
||||
|
||||
def tearDown(self):
|
||||
self.teardown_beets()
|
||||
|
||||
def test_tags_not_scrubbed(self):
|
||||
config['plugins'] = ['scrub']
|
||||
config['scrub']['auto'] = False
|
||||
config['import']['write'] = False
|
||||
self.importer.run()
|
||||
albums = self.lib.albums()
|
||||
self.assertEqual(len(albums), 1)
|
||||
self.assertEqual(albums[0].albumartist, 'Tag Artist')
|
||||
|
||||
def test_tags_restored(self):
|
||||
config['plugins'] = ['scrub']
|
||||
config['scrub']['auto'] = True
|
||||
config['import']['write'] = True
|
||||
self.importer.run()
|
||||
albums = self.lib.albums()
|
||||
self.assertEqual(len(albums), 1)
|
||||
self.assertEqual(albums[0].albumartist, 'Tag Artist')
|
||||
|
||||
def test_tags_not_restored(self):
|
||||
config['plugins'] = ['scrub']
|
||||
config['scrub']['auto'] = True
|
||||
config['import']['write'] = False
|
||||
self.importer.run()
|
||||
albums = self.lib.albums()
|
||||
self.assertEqual(len(albums), 1)
|
||||
self.assertEqual(albums[0].albumartist, 'Tag Artist')
|
||||
|
||||
|
||||
@_common.slow_test()
|
||||
class NonAutotaggedImportTest(_common.TestCase, ImportHelper):
|
||||
def setUp(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue