mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-22 14:25:12 +00:00
add unit test for function parse_m3u3_attributes in utils.py
This commit is contained in:
parent
1980ff4550
commit
8b1863dec9
@ -91,6 +91,7 @@ from youtube_dl.utils import (
|
||||
urljoin,
|
||||
urlencode_postdata,
|
||||
urshift,
|
||||
parse_m3u8_attributes,
|
||||
update_url_query,
|
||||
version_tuple,
|
||||
xpath_with_ns,
|
||||
@ -1427,6 +1428,17 @@ Line 1
|
||||
self.assertEqual(rot47('youtube-dl'), r'J@FEF36\5=')
|
||||
self.assertEqual(rot47('YOUTUBE-DL'), r'*~&%&qt\s{')
|
||||
|
||||
def test_parse_m3u7_attributes(self):
|
||||
self.assertEqual(parse_m3u8_attributes("1=2"), {'1': '2'})
|
||||
self.assertEqual(parse_m3u8_attributes("A=B"), {'A': 'B'})
|
||||
self.assertEqual(parse_m3u8_attributes("1A=2"), {'1A': '2'})
|
||||
self.assertEqual(parse_m3u8_attributes("1=2B"), {'1': '2B'})
|
||||
self.assertEqual(parse_m3u8_attributes("1=2,3=4"), {'1':'2', '3':'4'})
|
||||
self.assertEqual(parse_m3u8_attributes("1=\"2\""), {'1':'2'})
|
||||
self.assertEqual(parse_m3u8_attributes("1a=2"), {})
|
||||
self.assertEqual(parse_m3u8_attributes("1=2b"), {'1':'2b'})
|
||||
self.assertEqual(parse_m3u8_attributes(""), {})
|
||||
|
||||
def test_urshift(self):
|
||||
self.assertEqual(urshift(3, 1), 1)
|
||||
self.assertEqual(urshift(-3, 1), 2147483646)
|
||||
|
Loading…
Reference in New Issue
Block a user