grooveshark: migrate from ICapVideo to ICapAudio

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2014-01-02 02:09:34 +01:00
commit 444da30c3a
3 changed files with 75 additions and 75 deletions

View file

@ -19,32 +19,32 @@
from weboob.tools.test import BackendTest
from weboob.capabilities.video import BaseVideo
from weboob.capabilities.audio import BaseAudio
class GroovesharkTest(BackendTest):
BACKEND = 'grooveshark'
def test_grooveshark_video_search(self):
result = list(self.backend.search_videos("Loic Lantoine"))
def test_grooveshark_audio_search(self):
result = list(self.backend.search_audios("Loic Lantoine"))
self.assertTrue(len(result) > 0)
def test_grooveshark_user_playlist(self):
l1 = list(self.backend.iter_resources([BaseVideo], [u'playlists']))
l1 = list(self.backend.iter_resources([BaseAudio], [u'playlists']))
assert len(l1)
c = l1[0]
l2 = list(self.backend.iter_resources([BaseVideo], c.split_path))
l2 = list(self.backend.iter_resources([BaseAudio], c.split_path))
assert len(l2)
v = l2[0]
self.backend.fillobj(v, ('url',))
self.assertTrue(v.url is not None, 'URL for video "%s" not found: %s' % (v.id, v.url))
self.assertTrue(v.url is not None, 'URL for audio "%s" not found: %s' % (v.id, v.url))
def test_grooveshark_album_search(self):
l1 = list(self.backend.iter_resources([BaseVideo], [u'albums', u'live']))
l1 = list(self.backend.iter_resources([BaseAudio], [u'albums', u'live']))
assert len(l1)
c = l1[0]
l2 = list(self.backend.iter_resources([BaseVideo], c.split_path))
l2 = list(self.backend.iter_resources([BaseAudio], c.split_path))
assert len(l2)
v = l2[0]
self.backend.fillobj(v, ('url',))
self.assertTrue(v.url is not None, 'URL for video "%s" not found: %s' % (v.id, v.url))
self.assertTrue(v.url is not None, 'URL for audio "%s" not found: %s' % (v.id, v.url))