diff options
author | Sergey M. <dstftw@gmail.com> | 2014-02-17 03:46:26 +0700 |
---|---|---|
committer | Sergey M. <dstftw@gmail.com> | 2014-02-17 03:46:26 +0700 |
commit | 2db806b4aa0047002cf4c8b1ce6e3dd79ab8ee69 (patch) | |
tree | d64b93df5c2d52222a15619a71148e9a2ab15b2d /test | |
parent | 3f32c0ba4c9b7d9d654588d3bb0b88e41d4a0113 (diff) |
Improve parse_duration
Diffstat (limited to 'test')
-rw-r--r-- | test/test_utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index 1ca5f5af8..84553b943 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -202,7 +202,16 @@ class TestUtil(unittest.TestCase): self.assertEqual(parse_duration('1'), 1) self.assertEqual(parse_duration('1337:12'), 80232) self.assertEqual(parse_duration('9:12:43'), 33163) + self.assertEqual(parse_duration('12:00'), 720) + self.assertEqual(parse_duration('00:01:01'), 61) self.assertEqual(parse_duration('x:y'), None) + self.assertEqual(parse_duration('3h11m53s'), 11513) + self.assertEqual(parse_duration('62m45s'), 3765) + self.assertEqual(parse_duration('6m59s'), 419) + self.assertEqual(parse_duration('49s'), 49) + self.assertEqual(parse_duration('0h0m0s'), 0) + self.assertEqual(parse_duration('0m0s'), 0) + self.assertEqual(parse_duration('0s'), 0) def test_fix_xml_ampersands(self): self.assertEqual( |