aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-09-30 07:56:24 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-10-01 00:08:28 +0200
commit410f3e73ab268f74a455798ee39de5caba90caea (patch)
tree4a79ee7c8fe20462a7bdad6bfbeca51fcb7ca747 /test
parent07e764439a1cdd3a3b95fbf21acc6a517c6a889e (diff)
downloadyoutube-dl-410f3e73ab268f74a455798ee39de5caba90caea.tar.xz
[utils] Fix js_to_json
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index 97551ce9c..113aa44b2 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -44,6 +44,7 @@ from youtube_dl.utils import (
limit_length,
escape_rfc3986,
escape_url,
+ js_to_json,
)
@@ -331,5 +332,14 @@ class TestUtil(unittest.TestCase):
)
self.assertEqual(escape_url('http://vimeo.com/56015672#at=0'), 'http://vimeo.com/56015672#at=0')
+ def test_js_to_json(self):
+ inp = '''{
+ 'clip':{'provider':'pseudo'}
+ }'''
+ self.assertEqual(js_to_json(inp), '''{
+ "clip":{"provider":"pseudo"}
+ }''')
+ json.loads(js_to_json(inp))
+
if __name__ == '__main__':
unittest.main()