File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff 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+
8691def 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" )
You can’t perform that action at this time.
0 commit comments