[cbs:playlist] Improve tests

Mark Colbert test with actual playlist count of 30, instead of a
minimum. 30 is 15 clips and 15 full episodes.

Add another test (only_matching) for a show with no clips, only episodes:
Star Trek. playlist count is 15.
This commit is contained in:
John Hawkinson 2017-03-25 12:39:25 -04:00
parent 9961f53795
commit 53b53c6638

View File

@ -29,14 +29,25 @@ class CBSShowIE(InfoExtractor):
IE_DESC = 'CBS show playlists, including full episodes and clips' IE_DESC = 'CBS show playlists, including full episodes and clips'
IE_NAME = 'cbs.com:playlist' IE_NAME = 'cbs.com:playlist'
_VALID_URL = r'(?i)https?://(?:www\.)cbs.com/shows/(?P<id>[\w-]+)/?$' _VALID_URL = r'(?i)https?://(?:www\.)cbs.com/shows/(?P<id>[\w-]+)/?$'
_TEST = { _TESTS = [
'url': 'http://www.cbs.com/shows/the-late-show-with-stephen-colbert', {
'info_dict': { 'url': 'http://www.cbs.com/shows/the-late-show-with-stephen-colbert',
'id': 61456254, 'info_dict': {
'title': 'The Late Show with Stephen Colbert', 'id': 61456254,
'title': 'The Late Show with Stephen Colbert',
},
'playlist_count': 30,
}, },
'playlist_mincount': 14, {
} 'url': 'http://www.cbs.com/shows/star_trek/',
'info_dict': {
'id': 22927,
'title': 'Star Trek - The Original Series',
},
'playlist_count': 15, # No clips, only episodes
'only_matching': True,
},
]
def carousel_playlist(self, url, type): def carousel_playlist(self, url, type):
carousel = self._download_json(url, 'Downloading %s carousel' % type) carousel = self._download_json(url, 'Downloading %s carousel' % type)