mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-23 01:16:18 +00:00
Added test case for embeded album art
This commit is contained in:
parent
9ab6af1ae6
commit
29e462e0b8
@ -32,6 +32,13 @@ class MediaTestCase(ApiTestBase):
|
|||||||
)
|
)
|
||||||
self.folderid = folder.id
|
self.folderid = folder.id
|
||||||
|
|
||||||
|
folder_embeded_art = Folder(
|
||||||
|
name = 'Root',
|
||||||
|
path = os.path.abspath('tests/assets/folder'),
|
||||||
|
root = True,
|
||||||
|
)
|
||||||
|
self.folderid_embeded = folder_embeded_art.id
|
||||||
|
|
||||||
artist = Artist(name = 'Artist')
|
artist = Artist(name = 'Artist')
|
||||||
album = Album(artist = artist, name = 'Album')
|
album = Album(artist = artist, name = 'Album')
|
||||||
|
|
||||||
@ -50,6 +57,20 @@ class MediaTestCase(ApiTestBase):
|
|||||||
last_modification = 0
|
last_modification = 0
|
||||||
)
|
)
|
||||||
self.trackid = track.id
|
self.trackid = track.id
|
||||||
|
track_embeded_art = Track(
|
||||||
|
title = '[silence]',
|
||||||
|
number = 1,
|
||||||
|
disc = 1,
|
||||||
|
artist = artist,
|
||||||
|
album = album,
|
||||||
|
path = os.path.abspath('tests/assets/folder/silence.mp3'),
|
||||||
|
root_folder = folder_embeded_art,
|
||||||
|
folder = folder_embeded_art,
|
||||||
|
duration = 2,
|
||||||
|
bitrate = 320,
|
||||||
|
content_type = 'audio/mpeg',
|
||||||
|
last_modification = 0
|
||||||
|
)
|
||||||
|
|
||||||
def test_stream(self):
|
def test_stream(self):
|
||||||
self._make_request('stream', error = 10)
|
self._make_request('stream', error = 10)
|
||||||
@ -121,6 +142,15 @@ class MediaTestCase(ApiTestBase):
|
|||||||
|
|
||||||
# TODO test non square covers
|
# TODO test non square covers
|
||||||
|
|
||||||
|
# Test extracting cover art from embeded media
|
||||||
|
args['id'] = str(self.folderid_embeded)
|
||||||
|
rv = self.client.get('/rest/getCoverArt.view', query_string = args)
|
||||||
|
self.assertEqual(rv.status_code, 200)
|
||||||
|
self.assertEqual(rv.mimetype, 'image/png')
|
||||||
|
im = Image.open(BytesIO(rv.data))
|
||||||
|
self.assertEqual(im.format, 'PNG')
|
||||||
|
self.assertEqual(im.size, (120, 120))
|
||||||
|
|
||||||
def test_get_lyrics(self):
|
def test_get_lyrics(self):
|
||||||
self._make_request('getLyrics', error = 10)
|
self._make_request('getLyrics', error = 10)
|
||||||
self._make_request('getLyrics', { 'artist': 'artist' }, error = 10)
|
self._make_request('getLyrics', { 'artist': 'artist' }, error = 10)
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user