aboutsummaryrefslogtreecommitdiff
path: root/test/helper.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-08-02 03:46:45 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-08-02 03:47:31 +0530
commit0855702f3f3855974609cf3e99334de0d5d166e3 (patch)
tree17d822fdcf9b0e140c1008a19c4d047ae3a015c8 /test/helper.py
parente8384376c029f071927dafb6f8debb7e3eb847c2 (diff)
[test:download] Support testing with `ignore_no_formats_error`
Diffstat (limited to 'test/helper.py')
-rw-r--r--test/helper.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/helper.py b/test/helper.py
index b40ffe3ce..9599eab8e 100644
--- a/test/helper.py
+++ b/test/helper.py
@@ -198,7 +198,10 @@ def expect_info_dict(self, got_dict, expected_dict):
expect_dict(self, got_dict, expected_dict)
# Check for the presence of mandatory fields
if got_dict.get('_type') not in ('playlist', 'multi_video'):
- for key in ('id', 'url', 'title', 'ext'):
+ mandatory_fields = ['id', 'title']
+ if expected_dict.get('ext'):
+ mandatory_fields.extend(('url', 'ext'))
+ for key in mandatory_fields:
self.assertTrue(got_dict.get(key), 'Missing mandatory field %s' % key)
# Check for mandatory fields that are automatically set by YoutubeDL
for key in ['webpage_url', 'extractor', 'extractor_key']: