tests: don't run the test if any of the extractors listed in the 'add_ie' field is marked as not working

This commit is contained in:
Jaime Marquínez Ferrándiz 2013-11-03 19:14:53 +01:00
parent da54be877a
commit 9ee2b5f6f2
5 changed files with 12 additions and 1 deletions

View file

@ -31,6 +31,7 @@ from youtube_dl.utils import (
ExtractorError, ExtractorError,
UnavailableVideoError, UnavailableVideoError,
) )
from youtube_dl.extractor import get_info_extractor
RETRIES = 3 RETRIES = 3
@ -63,9 +64,10 @@ def generator(test_case):
def test_template(self): def test_template(self):
ie = youtube_dl.extractor.get_info_extractor(test_case['name']) ie = youtube_dl.extractor.get_info_extractor(test_case['name'])
other_ies = [get_info_extractor(ie_key) for ie_key in test_case.get('add_ie', [])]
def print_skipping(reason): def print_skipping(reason):
print('Skipping %s: %s' % (test_case['name'], reason)) print('Skipping %s: %s' % (test_case['name'], reason))
if not ie._WORKING: if not ie.working():
print_skipping('IE marked as not _WORKING') print_skipping('IE marked as not _WORKING')
return return
if 'playlist' not in test_case: if 'playlist' not in test_case:
@ -77,6 +79,10 @@ def generator(test_case):
if 'skip' in test_case: if 'skip' in test_case:
print_skipping(test_case['skip']) print_skipping(test_case['skip'])
return return
for other_ie in other_ies:
if not other_ie.working():
print_skipping(u'test depends on %sIE, marked as not WORKING' % other_ie.ie_key())
return
params = get_params(test_case.get('params', {})) params = get_params(test_case.get('params', {}))

View file

@ -33,6 +33,7 @@ class GenericIE(InfoExtractor):
}, },
# embedded vimeo video # embedded vimeo video
{ {
u'add_ie': ['Vimeo'],
u'url': u'http://skillsmatter.com/podcast/home/move-semanticsperfect-forwarding-and-rvalue-references', u'url': u'http://skillsmatter.com/podcast/home/move-semanticsperfect-forwarding-and-rvalue-references',
u'file': u'22444065.mp4', u'file': u'22444065.mp4',
u'md5': u'2903896e23df39722c33f015af0666e2', u'md5': u'2903896e23df39722c33f015af0666e2',
@ -44,6 +45,7 @@ class GenericIE(InfoExtractor):
}, },
# bandcamp page with custom domain # bandcamp page with custom domain
{ {
u'add_ie': ['Bandcamp'],
u'url': u'http://bronyrock.com/track/the-pony-mash', u'url': u'http://bronyrock.com/track/the-pony-mash',
u'file': u'3235767654.mp3', u'file': u'3235767654.mp3',
u'info_dict': { u'info_dict': {

View file

@ -26,6 +26,7 @@ class MTVIE(InfoExtractor):
}, },
}, },
{ {
u'add_ie': ['Vevo'],
u'url': u'http://www.mtv.com/videos/taylor-swift/916187/everything-has-changed-ft-ed-sheeran.jhtml', u'url': u'http://www.mtv.com/videos/taylor-swift/916187/everything-has-changed-ft-ed-sheeran.jhtml',
u'file': u'USCJY1331283.mp4', u'file': u'USCJY1331283.mp4',
u'md5': u'73b4e7fcadd88929292fe52c3ced8caf', u'md5': u'73b4e7fcadd88929292fe52c3ced8caf',

View file

@ -7,6 +7,7 @@ class SlashdotIE(InfoExtractor):
_VALID_URL = r'https?://tv.slashdot.org/video/\?embed=(?P<id>.*?)(&|$)' _VALID_URL = r'https?://tv.slashdot.org/video/\?embed=(?P<id>.*?)(&|$)'
_TEST = { _TEST = {
u'add_ie': ['Ooyala'],
u'url': u'http://tv.slashdot.org/video/?embed=JscHMzZDplD0p-yNLOzTfzC3Q3xzJaUz', u'url': u'http://tv.slashdot.org/video/?embed=JscHMzZDplD0p-yNLOzTfzC3Q3xzJaUz',
u'file': u'JscHMzZDplD0p-yNLOzTfzC3Q3xzJaUz.mp4', u'file': u'JscHMzZDplD0p-yNLOzTfzC3Q3xzJaUz.mp4',
u'md5': u'd2222e7a4a4c1541b3e0cf732fb26735', u'md5': u'd2222e7a4a4c1541b3e0cf732fb26735',

View file

@ -13,6 +13,7 @@ class WeiboIE(InfoExtractor):
_VALID_URL = r'https?://video\.weibo\.com/v/weishipin/t_(?P<id>.+?)\.htm' _VALID_URL = r'https?://video\.weibo\.com/v/weishipin/t_(?P<id>.+?)\.htm'
_TEST = { _TEST = {
u'add_ie': ['Sina'],
u'url': u'http://video.weibo.com/v/weishipin/t_zjUw2kZ.htm', u'url': u'http://video.weibo.com/v/weishipin/t_zjUw2kZ.htm',
u'file': u'98322879.flv', u'file': u'98322879.flv',
u'info_dict': { u'info_dict': {