aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2020-11-20 00:52:59 +0530
committerpukkandan <pukkandan@gmail.com>2020-11-20 13:03:32 +0530
commit8bdd16b4993b8d546b4cbbdbe4710db0bc2f971b (patch)
treec5ba0d26e17bb3102c0b24886853d9a818e875c6 /test/test_utils.py
parent228385340e9a976f52735078218a9b8ecfe7ae7a (diff)
downloadhypervideo-pre-8bdd16b4993b8d546b4cbbdbe4710db0bc2f971b.tar.lz
hypervideo-pre-8bdd16b4993b8d546b4cbbdbe4710db0bc2f971b.tar.xz
hypervideo-pre-8bdd16b4993b8d546b4cbbdbe4710db0bc2f971b.zip
Merge 'ytdl-org/youtube-dl/master' release 2020.11.19
Old Extractors left behind: VLivePlaylistIE YoutubeSearchURLIE YoutubeShowIE YoutubeFavouritesIE If removing old extractors, make corresponding changes in docs/supportedsites.md youtube_dlc/extractor/extractors.py Not merged: .github/ISSUE_TEMPLATE/1_broken_site.md .github/ISSUE_TEMPLATE/2_site_support_request.md .github/ISSUE_TEMPLATE/3_site_feature_request.md .github/ISSUE_TEMPLATE/4_bug_report.md .github/ISSUE_TEMPLATE/5_feature_request.md test/test_all_urls.py youtube_dlc/version.py Changelog
Diffstat (limited to 'test/test_utils.py')
-rw-r--r--test/test_utils.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index 95231200b..16ad40831 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -937,6 +937,28 @@ class TestUtil(unittest.TestCase):
self.assertEqual(d['x'], 1)
self.assertEqual(d['y'], 'a')
+ # Just drop ! prefix for now though this results in a wrong value
+ on = js_to_json('''{
+ a: !0,
+ b: !1,
+ c: !!0,
+ d: !!42.42,
+ e: !!![],
+ f: !"abc",
+ g: !"",
+ !42: 42
+ }''')
+ self.assertEqual(json.loads(on), {
+ 'a': 0,
+ 'b': 1,
+ 'c': 0,
+ 'd': 42.42,
+ 'e': [],
+ 'f': "abc",
+ 'g': "",
+ '42': 42
+ })
+
on = js_to_json('["abc", "def",]')
self.assertEqual(json.loads(on), ['abc', 'def'])
@@ -994,6 +1016,12 @@ class TestUtil(unittest.TestCase):
on = js_to_json('{42:4.2e1}')
self.assertEqual(json.loads(on), {'42': 42.0})
+ on = js_to_json('{ "0x40": "0x40" }')
+ self.assertEqual(json.loads(on), {'0x40': '0x40'})
+
+ on = js_to_json('{ "040": "040" }')
+ self.assertEqual(json.loads(on), {'040': '040'})
+
def test_js_to_json_malformed(self):
self.assertEqual(js_to_json('42a1'), '42"a1"')
self.assertEqual(js_to_json('42a-1'), '42"a"-1')