from test.helper import (
assertGreaterEqual,
+ assertLessEqual,
expect_warnings,
get_params,
gettestcases,
params['outtmpl'] = tname + '_' + params['outtmpl']
if is_playlist and 'playlist' not in test_case:
params.setdefault('extract_flat', 'in_playlist')
- params.setdefault('playlistend', test_case.get('playlist_mincount'))
+ params.setdefault('playlistend',
+ test_case['playlist_maxcount'] + 1
+ if test_case.get('playlist_maxcount')
+ else test_case.get('playlist_mincount'))
params.setdefault('skip_download', True)
ydl = YoutubeDL(params, auto_init=False)
'Expected at least %d in playlist %s, but got only %d' % (
test_case['playlist_mincount'], test_case['url'],
len(res_dict['entries'])))
+ if 'playlist_maxcount' in test_case:
+ assertLessEqual(
+ self,
+ len(res_dict['entries']),
+ test_case['playlist_maxcount'],
+ 'Expected at most %d in playlist %s, but got %d' % (
+ test_case['playlist_maxcount'], test_case['url'],
+ len(res_dict['entries'])))
if 'playlist_count' in test_case:
self.assertEqual(
len(res_dict['entries']),