Fetchart / ignore settings tests

This commit is contained in:
Reg 2018-12-20 18:38:14 +01:00
parent 0696f915e5
commit 54a83fa941

View file

@ -54,6 +54,43 @@ class FetchartCliTest(unittest.TestCase, TestHelper):
self.album.load()
self.assertEqual(self.album['artpath'], None)
def test_filesystem_does_not_pick_up_ignored_file(self):
self.touch(b'co_ver.jpg', dir=self.album.path, content='IMAGE')
self.config['ignore'] = ['*_*']
self.run_command('fetchart')
self.album.load()
self.assertEqual(self.album['artpath'], None)
def test_filesystem_picks_up_non_ignored_file(self):
self.touch(b'cover.jpg', dir=self.album.path, content='IMAGE')
self.config['ignore'] = ['*_*']
self.run_command('fetchart')
self.album.load()
self.check_cover_is_stored()
def test_filesystem_does_not_pick_up_hidden_file(self):
self.touch(b'.cover.jpg', dir=self.album.path, content='IMAGE')
self.config['ignore'] = [] # By default, ignore includes '.*'.
self.config['ignore_hidden'] = True
self.run_command('fetchart')
self.album.load()
self.assertEqual(self.album['artpath'], None)
def test_filesystem_picks_up_non_hidden_file(self):
self.touch(b'cover.jpg', dir=self.album.path, content='IMAGE')
self.config['ignore_hidden'] = True
self.run_command('fetchart')
self.album.load()
self.check_cover_is_stored()
def test_filesystem_picks_up_hidden_file(self):
self.touch(b'.cover.jpg', dir=self.album.path, content='IMAGE')
self.config['ignore'] = [] # By default, ignore includes '.*'.
self.config['ignore_hidden'] = False
self.run_command('fetchart')
self.album.load()
self.check_cover_is_stored()
def suite():
return unittest.TestLoader().loadTestsFromName(__name__)