dailymotion: Chose a random video to test
Did this mostly because the first video had an issue, it was first in the search results but deleted (the page was "410 Gone"). But this ends up testing more videos anyway.
This commit is contained in:
parent
2eb2747ebb
commit
96860fcb97
1 changed files with 4 additions and 2 deletions
|
|
@ -21,6 +21,8 @@
|
|||
from weboob.tools.test import BackendTest
|
||||
from weboob.capabilities.video import BaseVideo
|
||||
|
||||
from random import choice
|
||||
|
||||
|
||||
class DailymotionTest(BackendTest):
|
||||
BACKEND = 'dailymotion'
|
||||
|
|
@ -28,7 +30,7 @@ class DailymotionTest(BackendTest):
|
|||
def test_search(self):
|
||||
l = list(self.backend.search_videos('chirac'))
|
||||
self.assertTrue(len(l) > 0)
|
||||
v = l[0]
|
||||
v = choice(l)
|
||||
self.backend.fillobj(v, ('url',))
|
||||
self.assertTrue(v.url and v.url.startswith('http://'), 'URL for video "%s" not found: %s' % (v.id, v.url))
|
||||
self.backend.browser.openurl(v.url)
|
||||
|
|
@ -36,6 +38,6 @@ class DailymotionTest(BackendTest):
|
|||
def test_latest(self):
|
||||
l = list(self.backend.iter_resources([BaseVideo], [u'latest']))
|
||||
assert len(l)
|
||||
v = l[0]
|
||||
v = choice(l)
|
||||
self.backend.fillobj(v, ('url',))
|
||||
self.assertTrue(v.url and v.url.startswith('http://'), 'URL for video "%s" not found: %s' % (v.id, v.url))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue