aboutsummaryrefslogtreecommitdiff
path: root/test/test_utils.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-07-10 23:40:45 +0800
committerGitHub <noreply@github.com>2016-07-10 23:40:45 +0800
commit0b68de3cc1f99ce8c49a497245c02d4d03201aa8 (patch)
tree885385b3b4968715eb2b7d51b4f66f3a12da7f46 /test/test_utils.py
parent39e9d524e5fe289936160d4c599a77f10f6e9061 (diff)
parent59bbe4911acd4493bf407925bfdeb1ad03db6ef3 (diff)
Merge pull request #8876 from remitamine/html5_media
[extractor/common] add helper method to extract html5 media entries
Diffstat (limited to 'test/test_utils.py')
-rw-r--r--test/test_utils.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index afd273a65..2273b5a10 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -81,6 +81,7 @@ from youtube_dl.utils import (
cli_option,
cli_valueless_option,
cli_bool_option,
+ parse_codecs,
)
from youtube_dl.compat import (
compat_chr,
@@ -608,6 +609,29 @@ class TestUtil(unittest.TestCase):
limit_length('foo bar baz asd', 12).startswith('foo bar'))
self.assertTrue('...' in limit_length('foo bar baz asd', 12))
+ def test_parse_codecs(self):
+ self.assertEqual(parse_codecs(''), {})
+ self.assertEqual(parse_codecs('avc1.77.30, mp4a.40.2'), {
+ 'vcodec': 'avc1.77.30',
+ 'acodec': 'mp4a.40.2',
+ })
+ self.assertEqual(parse_codecs('mp4a.40.2'), {
+ 'vcodec': 'none',
+ 'acodec': 'mp4a.40.2',
+ })
+ self.assertEqual(parse_codecs('mp4a.40.5,avc1.42001e'), {
+ 'vcodec': 'avc1.42001e',
+ 'acodec': 'mp4a.40.5',
+ })
+ self.assertEqual(parse_codecs('avc3.640028'), {
+ 'vcodec': 'avc3.640028',
+ 'acodec': 'none',
+ })
+ self.assertEqual(parse_codecs(', h264,,newcodec,aac'), {
+ 'vcodec': 'h264',
+ 'acodec': 'aac',
+ })
+
def test_escape_rfc3986(self):
reserved = "!*'();:@&=+$,/?#[]"
unreserved = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~'