mirror of
https://github.com/beetbox/beets.git
synced 2025-12-07 17:16:07 +01:00
embedart: Adapt tests for #2254
This commit is contained in:
parent
92ee141662
commit
e782885e50
3 changed files with 12 additions and 2 deletions
BIN
test/rsrc/image-jpeg.mp3
Normal file
BIN
test/rsrc/image-jpeg.mp3
Normal file
Binary file not shown.
|
|
@ -163,6 +163,17 @@ class EmbedartCliTest(_common.TestCase, TestHelper):
|
||||||
|
|
||||||
self.assertExists(os.path.join(albumpath, b'extracted.png'))
|
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.subprocess')
|
||||||
@patch('beets.art.extract')
|
@patch('beets.art.extract')
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,7 @@ class EdgeTest(unittest.TestCase):
|
||||||
with open(magic_bytes_file, 'rb') as f:
|
with open(magic_bytes_file, 'rb') as f:
|
||||||
jpg_data = f.read()
|
jpg_data = f.read()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
beets.mediafile.image_mime_type(jpg_data),
|
beets.mediafile._imghdr_what_wrapper(jpg_data), 'jpeg')
|
||||||
'image/jpeg')
|
|
||||||
|
|
||||||
def test_soundcheck_non_ascii(self):
|
def test_soundcheck_non_ascii(self):
|
||||||
# Make sure we don't crash when the iTunes SoundCheck field contains
|
# Make sure we don't crash when the iTunes SoundCheck field contains
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue