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:
83
83
)
84
84
85
85
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
+
86
91
def test_fix_time_overflow () -> None :
87
92
assert ForgivingTime ().pythonvalue ("24:00:00" ) == datetime .time (0 , 0 , 0 )
88
93
assert ForgivingTime ().pythonvalue ("23:59:59" ) == datetime .time (23 , 59 , 59 )
89
94
assert ForgivingTime ().pythonvalue ("23:59:60" ) == datetime .time (0 , 0 , 0 )
90
95
assert ForgivingTime ().pythonvalue ("23:59:61" ) == datetime .time (0 , 0 , 1 )
91
96
assert ForgivingTime ().pythonvalue ("23:60:00" ) == datetime .time (0 , 0 , 0 )
92
97
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