fix: raise ParseError for out-of-range times
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
1 parent
8099b4834b
commit
ba35014a06
2 files changed
+23
-1
No files matched your search
@@ -103,3 +103,21 @@ def test_cell_count_mismatch_is_a_parse_error():
|
||||
)
|
||||
with pytest.raises(ParseError, match="cells"):
|
||||
parse_page(html, "4", "X")
|
||||
|
||||
|
||||
def test_invalid_hour_is_a_parse_error():
|
||||
html = HEADER.format(
|
||||
ths=WORKDAY_TH,
|
||||
rows='<tr><td class="hour-cell">25</td><td class="minutes-cell">10 </td></tr>',
|
||||
)
|
||||
with pytest.raises(ParseError, match="invalid time"):
|
||||
parse_page(html, "4", "X")
|
||||
|
||||
|
||||
def test_invalid_minute_is_a_parse_error():
|
||||
html = HEADER.format(
|
||||
ths=WORKDAY_TH,
|
||||
rows='<tr><td class="hour-cell">04</td><td class="minutes-cell">99 </td></tr>',
|
||||
)
|
||||
with pytest.raises(ParseError, match="invalid time"):
|
||||
parse_page(html, "4", "X")
|
||||
Reference in new issue
Block a user