Use correct methods for ImageMagick and PIL info

This commit is contained in:
Jack Wilsdon 2016-04-27 20:33:21 +01:00
parent 8317a20bcd
commit 79d602b2a0
2 changed files with 4 additions and 4 deletions

View file

@ -92,11 +92,11 @@ class ThumbnailsPlugin(BeetsPlugin):
if not os.path.exists(dir):
os.makedirs(dir)
if has_IM():
if get_im_version():
self.write_metadata = write_metadata_im
tool = "IM"
else:
assert has_PIL() # since we're local
assert get_pil_version() # since we're local
self.write_metadata = write_metadata_pil
tool = "PIL"
self._log.debug(u"using {0} to write metadata", tool)

View file

@ -66,8 +66,8 @@ class ThumbnailsTest(unittest.TestCase, TestHelper):
@patch('beetsplug.thumbnails.os')
@patch('beetsplug.thumbnails.ArtResizer')
@patch('beetsplug.thumbnails.has_IM')
@patch('beetsplug.thumbnails.has_PIL')
@patch('beetsplug.thumbnails.get_im_version')
@patch('beetsplug.thumbnails.get_pil_version')
@patch('beetsplug.thumbnails.GioURI')
def test_check_local_ok(self, mock_giouri, mock_pil, mock_im,
mock_artresizer, mock_os):