1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
import os
from mediafile import MediaFile
from beets.test.helper import AsIsImporterMixin, ImportTestCase, PluginMixin
class ScrubbedImportTest(AsIsImporterMixin, PluginMixin, ImportTestCase):
db_on_disk = True
plugin = "scrub"
def test_tags_not_scrubbed(self):
with self.configure_plugin({"auto": False}):
self.run_asis_importer(write=True)
for item in self.lib.items():
imported_file = MediaFile(os.path.join(item.path))
assert imported_file.artist == "Tag Artist"
assert imported_file.album == "Tag Album"
def test_tags_restored(self):
with self.configure_plugin({"auto": True}):
self.run_asis_importer(write=True)
for item in self.lib.items():
imported_file = MediaFile(os.path.join(item.path))
assert imported_file.artist == "Tag Artist"
assert imported_file.album == "Tag Album"
def test_tags_not_restored(self):
with self.configure_plugin({"auto": True}):
self.run_asis_importer(write=False)
for item in self.lib.items():
imported_file = MediaFile(os.path.join(item.path))
assert imported_file.artist is None
assert imported_file.album is None
|