aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-02-02 21:48:54 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2015-02-02 21:48:54 +0100
commit8f4b58d70e29df13d6002579b5c9448acc89d6c1 (patch)
tree887a1e49cee709f58e7773bd5e9f2b73a1768351 /test
parent3fd45e03bf86c2ad2ef17362452a9a745dc10755 (diff)
downloadyoutube-dl-8f4b58d70e29df13d6002579b5c9448acc89d6c1.tar.xz
[ntvde] Add new extractor (Fixes #4850)
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index ebec7986f..0ffccd35f 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -238,6 +238,8 @@ class TestUtil(unittest.TestCase):
self.assertEqual(parse_duration('5 s'), 5)
self.assertEqual(parse_duration('3 min'), 180)
self.assertEqual(parse_duration('2.5 hours'), 9000)
+ self.assertEqual(parse_duration('02:03:04'), 7384)
+ self.assertEqual(parse_duration('01:02:03:04'), 93784)
def test_fix_xml_ampersands(self):
self.assertEqual(
@@ -371,6 +373,16 @@ class TestUtil(unittest.TestCase):
on = js_to_json('{"abc": true}')
self.assertEqual(json.loads(on), {'abc': True})
+ # Ignore JavaScript code as well
+ on = js_to_json('''{
+ "x": 1,
+ y: "a",
+ z: some.code
+ }''')
+ d = json.loads(on)
+ self.assertEqual(d['x'], 1)
+ self.assertEqual(d['y'], 'a')
+
def test_clean_html(self):
self.assertEqual(clean_html('a:\nb'), 'a: b')
self.assertEqual(clean_html('a:\n "b"'), 'a: "b"')