Skip to content

Commit e22637b

Browse files
committed
coverage
1 parent e8e23b5 commit e22637b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,20 @@ def test_fix_datetime_overflow() -> None:
8383
)
8484

8585

86+
def test_unfixable_datetime_overflow() -> None:
87+
with pytest.raises(ValueError, match="Invalid character while parsing minute"):
88+
FastDateTime().pythonvalue("2024-08-17T999:00:00Z")
89+
90+
8691
def test_fix_time_overflow() -> None:
8792
assert ForgivingTime().pythonvalue("24:00:00") == datetime.time(0, 0, 0)
8893
assert ForgivingTime().pythonvalue("23:59:59") == datetime.time(23, 59, 59)
8994
assert ForgivingTime().pythonvalue("23:59:60") == datetime.time(0, 0, 0)
9095
assert ForgivingTime().pythonvalue("23:59:61") == datetime.time(0, 0, 1)
9196
assert ForgivingTime().pythonvalue("23:60:00") == datetime.time(0, 0, 0)
9297
assert ForgivingTime().pythonvalue("23:61:00") == datetime.time(0, 1, 0)
98+
99+
100+
def test_unfixable_time_overflow() -> None:
101+
with pytest.raises(ValueError, match="Unrecognised ISO 8601 time format"):
102+
assert ForgivingTime().pythonvalue("999:00:00")

0 commit comments

Comments
 (0)