diff options
author | Paul Ganssle <paul@ganssle.io> | 2018-06-20 10:31:45 -0400 |
---|---|---|
committer | Paul Ganssle <paul@ganssle.io> | 2018-06-20 10:31:45 -0400 |
commit | a41c4c6b498189b1c456e2d8e7a21a308974bc89 (patch) | |
tree | 3a83e31ee78f8a3e6ca09066d632a43fcce639db /dateutil | |
parent | 0337fb4d4350533321cf30ac42f5d2725cee8d0b (diff) | |
download | dateutil-a41c4c6b498189b1c456e2d8e7a21a308974bc89.tar.gz |
Added tests for parse_isotime error condition
In the standard, 24 is only allowed as an hour at midnight exactly,
these tests ensure that while 24:00 and its variations are allowed,
non-midnight times with hour==24 fail.
Diffstat (limited to 'dateutil')
-rw-r--r-- | dateutil/test/test_isoparser.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/dateutil/test/test_isoparser.py b/dateutil/test/test_isoparser.py index b252228..f4fa943 100644 --- a/dateutil/test/test_isoparser.py +++ b/dateutil/test/test_isoparser.py @@ -484,6 +484,10 @@ def test_isotime_midnight(isostr): ('14:59:59+25:00', ValueError), # Invalid tz hours ('14:59:59+12:62', ValueError), # Invalid tz minutes ('14:59:30_344583', ValueError), # Invalid microsecond separator + ('24:01', ValueError), # 24 used for non-midnight time + ('24:00:01', ValueError), # 24 used for non-midnight time + ('24:00:00.001', ValueError), # 24 used for non-midnight time + ('24:00:00.000001', ValueError), # 24 used for non-midnight time ]) def test_isotime_raises(isostr, exception): iparser = isoparser() |