Skip to content

Commit

Permalink
Check if the info_dict has an url or a parts field in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimeMF committed Nov 25, 2013
1 parent 7760201 commit df05dc0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/test_download.py
Expand Up @@ -151,8 +151,9 @@ def try_rm_tcs_files():
sys.stderr.write(u'\n"info_dict": ' + json.dumps(test_info_dict, ensure_ascii=False, indent=2) + u'\n')

# Check for the presence of mandatory fields
for key in ('id', 'url', 'title', 'ext'):
for key in ('id', 'title', 'ext'):
self.assertTrue(key in info_dict.keys() and info_dict[key])
self.assertTrue(any(key in info_dict.keys() and info_dict[key] for key in ('url', 'parts')))
# Check for mandatory fields that are automatically set by YoutubeDL
for key in ['webpage_url', 'extractor', 'extractor_key']:
self.assertTrue(info_dict.get(key), u'Missing field: %s' % key)
Expand Down

0 comments on commit df05dc0

Please sign in to comment.