From ef89daf1bea40114430b65d2cace90b7078a4f6b Mon Sep 17 00:00:00 2001 From: Fabrice Laporte Date: Fri, 27 Jun 2014 23:32:57 +0200 Subject: [PATCH] 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 --- test/test_art.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_art.py b/test/test_art.py index 6d81496cc..30723ae7a 100644 --- a/test/test_art.py +++ b/test/test_art.py @@ -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'