aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-02-03 03:42:37 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2016-02-03 03:42:37 +0800
commit1df41411968b52d7fd6d0f0d233ad760aa5e6368 (patch)
tree4bb8bac57eb44f775a0c9bc2b93f0f7c8714bbac /test
parentfae45ede082e50a4935e014b47cbfde925c0f8ed (diff)
[test_YoutubeDL] Fix test_youtube_format_selection
Broken since a6c2c24479e5f4827ceb06f64d855329c0a6f593. Thanks to @jaimeMF and @anisse for pointing that out
Diffstat (limited to 'test')
-rw-r--r--test/test_YoutubeDL.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py
index 73910eaec..88c63010e 100644
--- a/test/test_YoutubeDL.py
+++ b/test/test_YoutubeDL.py
@@ -248,6 +248,17 @@ class TestFormatSelection(unittest.TestCase):
def format_info(f_id):
info = YoutubeIE._formats[f_id].copy()
+
+ # XXX: In real cases InfoExtractor._parse_mpd() fills up 'acodec'
+ # and 'vcodec', while in tests such information is incomplete since
+ # commit a6c2c24479e5f4827ceb06f64d855329c0a6f593
+ # test_YoutubeDL.test_youtube_format_selection is broken without
+ # this fix
+ if 'acodec' in info and 'vcodec' not in info:
+ info['vcodec'] = 'none'
+ elif 'vcodec' in info and 'acodec' not in info:
+ info['acodec'] = 'none'
+
info['format_id'] = f_id
info['url'] = 'url:' + f_id
return info