From 53b53c6638653b128d5945ee8c593c56ea496b21 Mon Sep 17 00:00:00 2001 From: John Hawkinson Date: Sat, 25 Mar 2017 12:39:25 -0400 Subject: [PATCH] [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. --- youtube_dl/extractor/cbs.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/cbs.py b/youtube_dl/extractor/cbs.py index fac7e6bfc..3e6573ff5 100644 --- a/youtube_dl/extractor/cbs.py +++ b/youtube_dl/extractor/cbs.py @@ -29,14 +29,25 @@ class CBSShowIE(InfoExtractor): IE_DESC = 'CBS show playlists, including full episodes and clips' IE_NAME = 'cbs.com:playlist' _VALID_URL = r'(?i)https?://(?:www\.)cbs.com/shows/(?P[\w-]+)/?$' - _TEST = { - 'url': 'http://www.cbs.com/shows/the-late-show-with-stephen-colbert', - 'info_dict': { - 'id': 61456254, - 'title': 'The Late Show with Stephen Colbert', + _TESTS = [ + { + 'url': 'http://www.cbs.com/shows/the-late-show-with-stephen-colbert', + 'info_dict': { + '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): carousel = self._download_json(url, 'Downloading %s carousel' % type)