embedart: Adapt tests for #2254

This commit is contained in:
nathdwek@laptop 2016-11-08 18:42:19 +01:00
parent 92ee141662
commit e782885e50
3 changed files with 12 additions and 2 deletions

BIN
test/rsrc/image-jpeg.mp3 Normal file

Binary file not shown.

View file

@ -163,6 +163,17 @@ class EmbedartCliTest(_common.TestCase, TestHelper):
self.assertExists(os.path.join(albumpath, b'extracted.png'))
def test_extracted_extension(self):
resource_path = os.path.join(_common.RSRC, b'image-jpeg.mp3')
album = self.add_album_fixture()
trackpath = album.items()[0].path
albumpath = album.path
shutil.copy(syspath(resource_path), syspath(trackpath))
self.run_command('extractart', '-n', 'extracted')
self.assertExists(os.path.join(albumpath, b'extracted.jpg'))
@patch('beets.art.subprocess')
@patch('beets.art.extract')

View file

@ -91,8 +91,7 @@ class EdgeTest(unittest.TestCase):
with open(magic_bytes_file, 'rb') as f:
jpg_data = f.read()
self.assertEqual(
beets.mediafile.image_mime_type(jpg_data),
'image/jpeg')
beets.mediafile._imghdr_what_wrapper(jpg_data), 'jpeg')
def test_soundcheck_non_ascii(self):
# Make sure we don't crash when the iTunes SoundCheck field contains