test_art: add unit test

the test checks that the keyword priority (related to its
position in the keywords list) is considered when selecting
image filename amongst several candidates
This commit is contained in:
Fabrice Laporte 2014-06-27 23:32:57 +02:00
parent 16f6a3daa7
commit ef89daf1be

View file

@ -78,6 +78,12 @@ class FSArtTest(_common.TestCase):
fn = fetchart.art_in_path(self.dpath, ('art',), True)
self.assertEqual(fn, None)
def test_precedence_amongst_correct_files(self):
_common.touch(os.path.join(self.dpath, 'back.jpg'))
_common.touch(os.path.join(self.dpath, 'front.jpg'))
_common.touch(os.path.join(self.dpath, 'front-cover.jpg'))
fn = fetchart.art_in_path(self.dpath, ('cover', 'front', 'back'), False)
self.assertEqual(fn, os.path.join(self.dpath, 'front-cover.jpg'))
class CombinedTest(_common.TestCase):
ASIN = 'xxxx'