From 8f4b58d70e29df13d6002579b5c9448acc89d6c1 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Mon, 2 Feb 2015 21:48:54 +0100 Subject: [ntvde] Add new extractor (Fixes #4850) --- test/test_utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') 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"') -- cgit v1.2.3